Skip to content

Commit e2616e4

Browse files
authored
browser(webkit): override global permissions (#1315)
For #652
1 parent 92aa4f3 commit e2616e4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

browser_patches/webkit/BUILD_NUMBER

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1171
1+
1172

browser_patches/webkit/patches/bootstrap.diff

+7-4
Original file line numberDiff line numberDiff line change
@@ -9798,7 +9798,7 @@ index 0000000000000000000000000000000000000000..76290475097e756e3d932d22be4d8c79
97989798
+
97999799
+} // namespace WebKit
98009800
diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp
9801-
index f971f96f4df83ebf505b2ddc4ae27e6ca7d5cc75..7478490cc0a8234569b01ae578a68cff982aa457 100644
9801+
index f971f96f4df83ebf505b2ddc4ae27e6ca7d5cc75..c9b85dd2fdd274efd594938924e3df27347358bd 100644
98029802
--- a/Source/WebKit/UIProcess/WebPageProxy.cpp
98039803
+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp
98049804
@@ -917,6 +917,7 @@ void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason)
@@ -10093,18 +10093,21 @@ index f971f96f4df83ebf505b2ddc4ae27e6ca7d5cc75..7478490cc0a8234569b01ae578a68cff
1009310093
auto request = m_geolocationPermissionRequestManager.createRequest(geolocationID);
1009410094
Function<void(bool)> completionHandler = [request = WTFMove(request)](bool allowed) {
1009510095
if (allowed)
10096-
@@ -7871,6 +7971,11 @@ void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID,
10097-
else
10096+
@@ -7872,6 +7972,14 @@ void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID,
1009810097
request->deny();
1009910098
};
10099+
1010010100
+ auto permissions = m_permissionsForAutomation.find(securityOrigin->toString());
10101+
+ if (permissions == m_permissionsForAutomation.end())
10102+
+ permissions = m_permissionsForAutomation.find("*");
1010110103
+ if (permissions != m_permissionsForAutomation.end()) {
1010210104
+ completionHandler(permissions->value.contains("geolocation"));
1010310105
+ return;
1010410106
+ }
10105-
10107+
+
1010610108
// FIXME: Once iOS migrates to the new WKUIDelegate SPI, clean this up
1010710109
// and make it one UIClient call that calls the completionHandler with false
10110+
// if there is no delegate instead of returning the completionHandler
1010810111
diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h
1010910112
index b3154548a08b588dfb346261bc7de3dbb754f6cf..4fc0e0fb6e7805d04b86bca46d5098fc69fe32e4 100644
1011010113
--- a/Source/WebKit/UIProcess/WebPageProxy.h

0 commit comments

Comments
 (0)