RESOLVED FIXED Bug 165502
[iOS] WKWebView should not allow app links to be opened on back or forward navigation
https://bugs.webkit.org/show_bug.cgi?id=165502
Summary [iOS] WKWebView should not allow app links to be opened on back or forward na...
Chelsea Pugh
Reported 2016-12-06 17:01:24 PST
WKWebView should not allow app links to be opened on back or forward navigation
Attachments
Patch for [iOS] WKWebView should not allow app links to be opened on back or forward navigation (10.07 KB, patch)
2016-12-06 17:15 PST, Chelsea Pugh
no flags
Patch (with style fixed) for [iOS] WKWebView should not allow app links to be opened on back or forward navigation (10.00 KB, patch)
2016-12-06 17:21 PST, Chelsea Pugh
no flags
v2 patch for [iOS] WKWebView should not allow app links to be opened on back or forward navigation (2.18 KB, patch)
2016-12-07 18:16 PST, Chelsea Pugh
no flags
Chelsea Pugh
Comment 1 2016-12-06 17:15:38 PST
Created attachment 296356 [details] Patch for [iOS] WKWebView should not allow app links to be opened on back or forward navigation
WebKit Commit Bot
Comment 2 2016-12-06 17:16:43 PST
Attachment 296356 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldNotOpenAppLinksOnBackForwardNavigation.mm:30: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chelsea Pugh
Comment 3 2016-12-06 17:21:53 PST
Created attachment 296357 [details] Patch (with style fixed) for [iOS] WKWebView should not allow app links to be opened on back or forward navigation
Sam Weinig
Comment 4 2016-12-07 14:51:44 PST
Comment on attachment 296357 [details] Patch (with style fixed) for [iOS] WKWebView should not allow app links to be opened on back or forward navigation I wonder if a better way to do this would be to update API::NavigationAction::shouldOpenAppLinks() to check that navigationType is not NavigationType::BackForward. I'm actually not sure, Dan?
mitz
Comment 5 2016-12-07 14:58:02 PST
(In reply to comment #4) > Comment on attachment 296357 [details] > Patch (with style fixed) for [iOS] WKWebView should not allow app links to > be opened on back or forward navigation > > I wonder if a better way to do this would be to update > API::NavigationAction::shouldOpenAppLinks() to check that navigationType is > not NavigationType::BackForward. I'm actually not sure, Dan? That’s possible, but that would be encoding (admittedly trivial) policy logic into what is currently a data container. I think, however, that WebPageProxy::decidePolicyForNavigationAction, which is where we currently initialize the NavigationAction, would be a good place to implement this policy. I agree that setting the m_shouldSuppressAppLinksInNextNavigationPolicyDecision in advance is unnecessarily complex and fragile.
Sam Weinig
Comment 6 2016-12-07 18:01:49 PST
(In reply to comment #5) > (In reply to comment #4) > > Comment on attachment 296357 [details] > > Patch (with style fixed) for [iOS] WKWebView should not allow app links to > > be opened on back or forward navigation > > > > I wonder if a better way to do this would be to update > > API::NavigationAction::shouldOpenAppLinks() to check that navigationType is > > not NavigationType::BackForward. I'm actually not sure, Dan? > > That’s possible, but that would be encoding (admittedly trivial) policy > logic into what is currently a data container. I think, however, that > WebPageProxy::decidePolicyForNavigationAction, which is where we currently > initialize the NavigationAction, would be a good place to implement this > policy. I agree that setting the > m_shouldSuppressAppLinksInNextNavigationPolicyDecision in advance is > unnecessarily complex and fragile. One thing I am also not sure of is what history.back()/history.forward()/history.go() should/would here. Probably worth testing.
Chelsea Pugh
Comment 7 2016-12-07 18:16:05 PST
Created attachment 296457 [details] v2 patch for [iOS] WKWebView should not allow app links to be opened on back or forward navigation
WebKit Commit Bot
Comment 8 2016-12-08 14:50:56 PST
Comment on attachment 296457 [details] v2 patch for [iOS] WKWebView should not allow app links to be opened on back or forward navigation Clearing flags on attachment: 296457 Committed r209573: <http://trac.webkit.org/changeset/209573>
WebKit Commit Bot
Comment 9 2016-12-08 14:51:00 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.