-
Notifications
You must be signed in to change notification settings - Fork 685
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
url provider should force http/https #227
Comments
Hmm, makes sense to whitelist only |
@jieter ok, we could do something inspired by what i do in bing layer plugin, fall back to http when the page is on file:// protocol see : https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Bing.js#L54 |
warning : as I mentioned, in Chrome extension scope, this is chrome:// protocol, not file:// ! |
@ludoo0d0a if you look at the code i'm pointing, you'll see that it use http only if the protocol of the page is file, in the other cases it stay in the document protocol. |
yes, that's the problem ;) Here the result in console in a chrome extension... >(document.location.protocol === 'file:') ? 'http' : document.location.protocol.slice(0, -1);
>"chrome-extension" if urlScheme stay the same as document.location.protocol, you never could reach our remote content... note protocol is chrome-extension:// in extension and chrome:// in chrome app (from what i remember) |
Ha my bad, so we just have to adapt the test a bit. Anyway, i was pointing this code in order to not forget users who will try to use the script locally (since https by default will break this use case). |
pas de souci 😜 |
@ludoo0d0a do you have a patch to propose or should we get on this ? |
Fixed by #258 |
I try to use your plugin in chrome extension.
Since url templates looks like url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', it failed to load tiles because under chrome:// protocol
I suppose your template is to stay in the same protocol as the website, but then can you add a test on current location.protocol and add a fallback as http ?
The text was updated successfully, but these errors were encountered: