RESOLVED FIXED 210620
Add a new 'limitNavigationsToAppBoundDomains' property to WKWebViewConfiguration
https://bugs.webkit.org/show_bug.cgi?id=210620
Summary Add a new 'limitNavigationsToAppBoundDomains' property to WKWebViewConfiguration
Brent Fulgham
Reported 2020-04-16 15:08:36 PDT
Update WKWebViewConfiguration, APIPageConfiguration, and WebPageProxy with a new flag indicating that the Developer would like to limit navigations of this web view to the set of app-bound domains specified in the Info.plist for the application.
Attachments
Patch (9.21 KB, patch)
2020-04-16 15:37 PDT, Brent Fulgham
no flags
Patch for landing (3.47 KB, patch)
2020-04-16 17:41 PDT, Brent Fulgham
ews-feeder: commit-queue-
Patch for landing (3.47 KB, patch)
2020-04-16 17:45 PDT, Brent Fulgham
no flags
Brent Fulgham
Comment 1 2020-04-16 15:08:55 PDT
Brent Fulgham
Comment 2 2020-04-16 15:37:06 PDT
Kate Cheney
Comment 3 2020-04-16 15:59:04 PDT
I think this looks good.
Andy Estes
Comment 4 2020-04-16 16:04:23 PDT
Comment on attachment 396710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396710&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:1256 > + _limitsNavigationToAppBoundDomains = !ignoresAppBoundDomains; Seems odd that setting one configuration property has the side effect of changing another one. If these two properties are mutually exclusive, should have a single enum property instead with possible values of `ignoresAppBoundDomains` and `limitsToAppBoundDomains`?
Brent Fulgham
Comment 5 2020-04-16 16:34:04 PDT
Comment on attachment 396710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396710&action=review >> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:1256 >> + _limitsNavigationToAppBoundDomains = !ignoresAppBoundDomains; > > Seems odd that setting one configuration property has the side effect of changing another one. If these two properties are mutually exclusive, should have a single enum property instead with possible values of `ignoresAppBoundDomains` and `limitsToAppBoundDomains`? One is internal SPI that is used to gate several things. I just wanted to make sure that when the SPI was used, this new flag wasn't left in an inconsistent state.
Andy Estes
Comment 6 2020-04-16 16:43:32 PDT
Comment on attachment 396710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396710&action=review >>> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:1256 >>> + _limitsNavigationToAppBoundDomains = !ignoresAppBoundDomains; >> >> Seems odd that setting one configuration property has the side effect of changing another one. If these two properties are mutually exclusive, should have a single enum property instead with possible values of `ignoresAppBoundDomains` and `limitsToAppBoundDomains`? > > One is internal SPI that is used to gate several things. I just wanted to make sure that when the SPI was used, this new flag wasn't left in an inconsistent state. But this just changes the value reflected by the API, not how it's enforced (but maybe that's for a follow-up). Anyway, I'd be in favor of not changing a value set by the API/SPI client but just documenting what the behavior is when there is a conflict between the two configuration settings.
EWS
Comment 7 2020-04-16 17:05:54 PDT
Committed r260228: <https://trac.webkit.org/changeset/260228> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396710 [details].
Brent Fulgham
Comment 8 2020-04-16 17:29:35 PDT
Reopening because I realized the setter wasn't correct.
Brent Fulgham
Comment 9 2020-04-16 17:41:31 PDT
Created attachment 396729 [details] Patch for landing
Brent Fulgham
Comment 10 2020-04-16 17:42:31 PDT
Comment on attachment 396710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396710&action=review >>>> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:1256 >>>> + _limitsNavigationToAppBoundDomains = !ignoresAppBoundDomains; >>> >>> Seems odd that setting one configuration property has the side effect of changing another one. If these two properties are mutually exclusive, should have a single enum property instead with possible values of `ignoresAppBoundDomains` and `limitsToAppBoundDomains`? >> >> One is internal SPI that is used to gate several things. I just wanted to make sure that when the SPI was used, this new flag wasn't left in an inconsistent state. > > But this just changes the value reflected by the API, not how it's enforced (but maybe that's for a follow-up). Anyway, I'd be in favor of not changing a value set by the API/SPI client but just documenting what the behavior is when there is a conflict between the two configuration settings. I'll land a follow-up fix addressing that.
Brent Fulgham
Comment 11 2020-04-16 17:45:51 PDT
Created attachment 396730 [details] Patch for landing
EWS
Comment 12 2020-04-16 18:09:35 PDT
Committed r260232: <https://trac.webkit.org/changeset/260232> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396730 [details].
EWS
Comment 13 2020-04-16 18:11:30 PDT
Patch 396729 does not build
Note You need to log in before you can comment on or make changes to this bug.