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

browser(webkit): override global permissions #1315

Merged
merged 1 commit into from
Mar 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion browser_patches/webkit/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1171
1172
11 changes: 7 additions & 4 deletions browser_patches/webkit/patches/bootstrap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -9798,7 +9798,7 @@ index 0000000000000000000000000000000000000000..76290475097e756e3d932d22be4d8c79
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp
index f971f96f4df83ebf505b2ddc4ae27e6ca7d5cc75..7478490cc0a8234569b01ae578a68cff982aa457 100644
index f971f96f4df83ebf505b2ddc4ae27e6ca7d5cc75..c9b85dd2fdd274efd594938924e3df27347358bd 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp
@@ -917,6 +917,7 @@ void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason)
Expand Down Expand Up @@ -10093,18 +10093,21 @@ index f971f96f4df83ebf505b2ddc4ae27e6ca7d5cc75..7478490cc0a8234569b01ae578a68cff
auto request = m_geolocationPermissionRequestManager.createRequest(geolocationID);
Function<void(bool)> completionHandler = [request = WTFMove(request)](bool allowed) {
if (allowed)
@@ -7871,6 +7971,11 @@ void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID,
else
@@ -7872,6 +7972,14 @@ void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID,
request->deny();
};

+ auto permissions = m_permissionsForAutomation.find(securityOrigin->toString());
+ if (permissions == m_permissionsForAutomation.end())
+ permissions = m_permissionsForAutomation.find("*");
+ if (permissions != m_permissionsForAutomation.end()) {
+ completionHandler(permissions->value.contains("geolocation"));
+ return;
+ }
+
// FIXME: Once iOS migrates to the new WKUIDelegate SPI, clean this up
// and make it one UIClient call that calls the completionHandler with false
// if there is no delegate instead of returning the completionHandler
diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h
index b3154548a08b588dfb346261bc7de3dbb754f6cf..4fc0e0fb6e7805d04b86bca46d5098fc69fe32e4 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.h
Expand Down