Change the bridge URLs so that they can be used in a CSP#264
Open
nilswx wants to merge 3 commits intomarcuswestin:masterfrom
nilswx:master
Open
Change the bridge URLs so that they can be used in a CSP#264nilswx wants to merge 3 commits intomarcuswestin:masterfrom nilswx:master
nilswx wants to merge 3 commits intomarcuswestin:masterfrom
nilswx:master
Conversation
The previous URLs contained leading/middle/trailing underscores, which are illegal to use as 'host-char' in a Content-Security-Policy. Changing them to hyphens makes WebViewJavascriptBridge compatible with solutions requiring a CSP.
The previous URLs contained leading/middle/trailing underscores, which are illegal to use as 'host-char' in a Content-Security-Policy. Changing them to hyphens makes WebViewJavascriptBridge compatible with solutions requiring a CSP.
marcuswestin
reviewed
Nov 8, 2017
| var WVJBIframe = document.createElement('iframe'); | ||
| WVJBIframe.style.display = 'none'; | ||
| WVJBIframe.src = 'https://__bridge_loaded__'; | ||
| WVJBIframe.src = 'https://wvjb-bridge_loaded'; |
Owner
There was a problem hiding this comment.
There's still an underscore in there. Are you sure this works as expected?
There was a problem hiding this comment.
I think there is a type error. It should be wvjb-bridge-loaded, is that right? @nilswiersema
Owner
|
Man, this is tricky. On the one hand, this is clearly an improvement. On the other hand, it's significant to ask everyone to fix up their code after an upgrade. Is there any way to be automatically backwards compatible? |
itbdw
reviewed
Nov 29, 2017
| var WVJBIframe = document.createElement('iframe'); | ||
| WVJBIframe.style.display = 'none'; | ||
| WVJBIframe.src = 'https://__bridge_loaded__'; | ||
| WVJBIframe.src = 'https://wvjb-bridge_loaded'; |
There was a problem hiding this comment.
There is a type error. It should be wvjb-bridge-loaded
@nilswiersema
|
I do agree with @nilswiersema . Here is my test sample. Problem sampleThen it will lead to fail Success samplethe difference is replace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous URLs contained leading/middle/trailing underscores, which are illegal to use as 'host-char' in a Content-Security-Policy.
Changing them to hyphens makes WebViewJavascriptBridge compatible with solutions requiring a CSP.
This pull request fixes issue #263.