We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, switching satellite images only works in Firefox. It is implemented by simply replacing the src tag
better-osm-org/better-osm-org.user.js
Line 749 in 00555e8
But this does not work in Chromium, which for some reason takes into account image-src CSP
Create an with the desired tile using GM_AddElement, and call replaceWith()
Lines 751 to 756 in 00555e8
But this breaks Leaflet: when zooming in, new tiles are not loaded (you can get around it by switching tiles twice)
replaceWith probably breaks tile object references that are important for Leaflet. (event handlers?)
I have no idea how to overcome this or even understanding how GM_addElement bypasses CSP
Interesting points in the ViolentMonkey source code
https://github.com/violentmonkey/violentmonkey/blob/692ffb97743fbbcd549d1ed81969e915125ebfd7/src/injected/content/gm-api-content.js#L31
https://github.com/violentmonkey/violentmonkey/blob/692ffb97743fbbcd549d1ed81969e915125ebfd7/src/background/utils/preinject.js#L625
The text was updated successfully, but these errors were encountered:
Not exactly about CSP, but probably solving this problem will also help to bypass bypass CORS for some imagery
Sorry, something went wrong.
No branches or pull requests
Currently, switching satellite images only works in Firefox. It is implemented by simply replacing the src tag
better-osm-org/better-osm-org.user.js
Line 749 in 00555e8
But this does not work in Chromium, which for some reason takes into account image-src CSP
Create an with the desired tile using GM_AddElement, and call replaceWith()
better-osm-org/better-osm-org.user.js
Lines 751 to 756 in 00555e8
But this breaks Leaflet: when zooming in, new tiles are not loaded (you can get around it by switching tiles twice)
replaceWith probably breaks tile object references that are important for Leaflet. (event handlers?)
I have no idea how to overcome this or even understanding how GM_addElement bypasses CSP
Interesting points in the ViolentMonkey source code
https://github.com/violentmonkey/violentmonkey/blob/692ffb97743fbbcd549d1ed81969e915125ebfd7/src/injected/content/gm-api-content.js#L31
https://github.com/violentmonkey/violentmonkey/blob/692ffb97743fbbcd549d1ed81969e915125ebfd7/src/background/utils/preinject.js#L625
The text was updated successfully, but these errors were encountered: