Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Explicit Specification whether the environment is Node or Browser #376

Closed
geo-systems opened this issue Dec 22, 2019 · 2 comments
Closed

Comments

@geo-systems
Copy link

Is your feature request related to a problem? Please describe.

I'm working on an Electron app. In Electron, each window has access to both the Node JS API and the web view API (e.g. the global window and window.document variables are defined).

Currently, tesseract.js checks if it's running in a browser and if so it treats all configuration paths as URLs - see here. I would like to force tesseract.js to work in "Node mode" and to treat the configuration paths as file paths.

Describe the solution you'd like

When initialising tesseract.js workers, add a new property to specify whether you're working in browser or Node js mode. This property can be optional - if it's not present then use the current logic.

@jeromewu
Copy link
Member

Hi,
Instead of adding an explicit environment type assignment, I have added electron environment check in getEnvironment() which should fix the issue.

@jeromewu
Copy link
Member

BTW, here is a repo for your reference: https://github.com/jeromewu/tesseract.js-electron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants