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

[ENHANCEMENT]: User enabled cross origin request. #46

Open
37TS opened this issue Sep 30, 2020 · 4 comments
Open

[ENHANCEMENT]: User enabled cross origin request. #46

37TS opened this issue Sep 30, 2020 · 4 comments
Labels
enhancement Extend a feature that exists in Komorebi, but doesn't do what you want it to.

Comments

@37TS
Copy link

37TS commented Sep 30, 2020

I'd really like to load textures out of 3D models I'm loading in a locally stored webpage but CORS isn't enabled and I cannot get some resources to load.
You can try with three.js' examples stored locally, like with this demo.

To try, download the master.zip from three.js and try to load the file.
It won't load the resources needed and you'll get a black screen. It works "ok" with a few examples but CORS is really mandatory if content is stored locally (unless you run a dedicated server in the system).

Could we possibly have such a feature as a checkbox in the main app (like with the mute option for videos, for example)?
I should be able to easily modify the source to make it available just for me but I really think that the community may benefit from the modification.

I'd appreciate your opinion on this, merely to know if I should wait for this implementation or if I should make it.

Have a nice day!

EDIT: of course, I can just re-pack the html so that all resources are within the webpage, but the point is about traversing folders. The possibilities it would bring are way beyond wallpapers. Interactive GUIs/3D file managers/you name it!

@Kangie
Copy link
Member

Kangie commented Oct 1, 2020

I should be able to easily modify the source to make it available just for me but I really think that the community may benefit from the modification.

If you submit a PR I'm happy to merge it. ;)

@Kangie Kangie added the enhancement Extend a feature that exists in Komorebi, but doesn't do what you want it to. label Oct 1, 2020
@Kangie Kangie changed the title User enabled cross origin request [ENHANCEMENT]: User enabled cross origin request. Oct 1, 2020
@37TS
Copy link
Author

37TS commented Oct 6, 2020

I've never used vala before but I've been able to read the code easily.
I'll give it a try but I can't make promises about PRs.

@Kangie
Copy link
Member

Kangie commented Oct 13, 2020

I've never used vala before but I've been able to read the code easily.
I'll give it a try but I can't make promises about PRs.

If you get the code working on your end and need support submitting a PR, I'm happy to help walk you through the process!

@rsubtil
Copy link
Member

rsubtil commented Oct 17, 2020

@37TS quick FYI, I found this today on Valadocs: https://valadoc.org/webkit2gtk-4.0/WebKit.SecurityManager.register_uri_scheme_as_cors_enabled.html

This looks like exactly what you need. I don't know much of this topic, but I suspect a simple webView.web_context.get_security_manager().register_uri_scheme_as_cors_enabled("http") will do the trick 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Extend a feature that exists in Komorebi, but doesn't do what you want it to.
Projects
None yet
Development

No branches or pull requests

3 participants