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

Better handle invalid schemes #1300

Merged
merged 2 commits into from Nov 30, 2015

Conversation

st3fan
Copy link
Contributor

@st3fan st3fan commented Nov 24, 2015

There are two related fixes in this patch:

• Better handle invalid schemes opened in popup windows. If the scheme is not in our whitelist, we consider it invalid and open a new tab without a context (WKConfiguration) that links to the parent window. After that webView:decidePolicyForNavigationAction: will be called and will show an appropriate error message that the URL cannot be opened.
• Make use of the new WKFrameInfo.securityOrigin to show better detailed titles in JavaScript originated alerts. (Via the WKWebView delegate)

The second is as a result of the first. With the first now allowing javascript: URLs resulted in a crash that is fixed by the second fix.

@st3fan st3fan force-pushed the st3fan/Bug1224910BetterHandleInvalidSchemes branch from cef7094 to a2fa603 Compare November 24, 2015 21:05
@@ -1678,13 +1683,30 @@ extension BrowserViewController: WKNavigationDelegate {
}
}

/// List of schemes that are allowed to open a popup window
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open in a popup window?

@thebnich thebnich changed the title Better handle invalid schemes Bug 1224910 - Better handle invalid schemes Nov 24, 2015
@thebnich thebnich changed the title Bug 1224910 - Better handle invalid schemes Better handle invalid schemes Nov 24, 2015
@st3fan st3fan force-pushed the st3fan/Bug1224910BetterHandleInvalidSchemes branch from d12dd38 to 2244e4c Compare November 30, 2015 19:35
st3fan added a commit that referenced this pull request Nov 30, 2015
…validSchemes

Better handle invalid schemes
@st3fan st3fan merged commit 1a417ed into master Nov 30, 2015
@farhanpatel farhanpatel deleted the st3fan/Bug1224910BetterHandleInvalidSchemes branch October 6, 2016 07:00
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 19, 2024
…e#1305)

* Added new test

* Update project.pbxproj

* Update project.pbxproj
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

Successfully merging this pull request may close these issues.

None yet

2 participants