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

jsaddle-webkit2gtk: "Not allowed to load local resource" #91

Open
autc04 opened this issue May 13, 2019 · 3 comments
Open

jsaddle-webkit2gtk: "Not allowed to load local resource" #91

autc04 opened this issue May 13, 2019 · 3 comments

Comments

@autc04
Copy link

autc04 commented May 13, 2019

I'm trying to include a javascript+css widget library from a reflex-dom app compiled with native jsaddle-webkit2gtk.
WebKit refuses:

file:///XXX/index.html:247:76: CONSOLE ERROR Not allowed to load local resource: file:///XXX/node_modules/onsenui/css/onsenui.css
file:///XXX/index.html:247:76: CONSOLE ERROR Not allowed to load local resource: file:///XXX/node_modules/onsenui/css/onsen-css-components.css
file:///XXX/index.html:247:76: CONSOLE ERROR Not allowed to load local resource: file:///XXX/style.css
file:///XXX/index.html:247:76: CONSOLE ERROR Not allowed to load local resource: file:///XXX/node_modules/onsenui/js/onsenui.js

The files are referenced via relative path URLs from my app.

Should a native app refuse to access file URLs? Is there a different way for loading resources in a native app?

@autc04
Copy link
Author

autc04 commented May 17, 2019

Update: if the current directory at program startup contains an index.html file, the above does not occur. An empty file seems to suffice.

@aidatorajiro
Copy link

Additional comment: If the resource is placed outside the executable's directory, the resource cannot be loaded due to "kCFErrorDomainCFNetwork" error. (jsaddle-0.9.7.0 , Mac OS 10.14.6)

@ibizaman
Copy link

ibizaman commented Sep 2, 2020

This could be a CORS issue. See https://stackoverflow.com/questions/8456538/origin-null-is-not-allowed-by-access-control-allow-origin and https://stackoverflow.com/a/37690646/1013628 for some suggestions on how to workaround the issue.

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

3 participants