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

Tesseract JS in Android #219

Closed
jarodium opened this issue Jun 2, 2018 · 4 comments
Closed

Tesseract JS in Android #219

jarodium opened this issue Jun 2, 2018 · 4 comments

Comments

@jarodium
Copy link

jarodium commented Jun 2, 2018

Hello

I am experiencing some issues getting Tesseract JS in an Android default webview ( e.g Chrome ).
I keep getting this error:

Uncaught securityerror: failed to construct 'worker' : access to the script at 'blobl:file:///.....' is denied by the documents content security policy.

My CSP in my page is as following:

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">

Should I try a different CSP? If so, can provide an example so that Tesseract works with an image?

Thanks in advance

@alikrc
Copy link

alikrc commented Sep 7, 2018

Behind the scenes tesseract works with web workers(https://www.w3schools.com/html/html5_webworkers.asp). Seems like you need to figure out if android allows this or not.

You can try this one

https://stackoverflow.com/questions/32020039/using-a-web-worker-in-a-local-file-webview

@SwagatRanjit84
Copy link

SwagatRanjit84 commented Feb 20, 2019

@jarodium @HasanAliKaraca Have you solved the problem? How did you implement on android? I wanted to use on react native!!

@jarodium
Copy link
Author

@SwagatRanjit84 haven't figured it out yet.

@jeromewu
Copy link
Member

You can use workerBlobURL to solve the issue, more details in this PR: #322

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

4 participants