Skip to content

Commit

Permalink
browser(firefox): rely on upstream permission separation per contexts (
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov authored Jun 17, 2020
1 parent 090d450 commit 082bb3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 36 deletions.
2 changes: 1 addition & 1 deletion browser_patches/firefox/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1111
1112
35 changes: 0 additions & 35 deletions browser_patches/firefox/patches/bootstrap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -1121,41 +1121,6 @@ index 82d04ec3a72f3390a43c98eb2ae91f0d15a83631..b197bb0718ed712af2a7c08d2ef691de
void UpdateLanguages(const nsTArray<nsString>& aLanguages);

void UpdateJSWorkerMemoryParameter(JSGCParamKey key, Maybe<uint32_t> value);
diff --git a/extensions/permissions/Permission.cpp b/extensions/permissions/Permission.cpp
index 72ed1de82fd322ba2cafffbad5622e2fdb6aa677..0dd907ff05d1df313dd3b8f8561c4ab3296e2931 100644
--- a/extensions/permissions/Permission.cpp
+++ b/extensions/permissions/Permission.cpp
@@ -34,7 +34,7 @@ already_AddRefed<nsIPrincipal> Permission::ClonePrincipalForPermission(

mozilla::OriginAttributes attrs = aPrincipal->OriginAttributesRef();
if (!StaticPrefs::permissions_isolateBy_userContext()) {
- attrs.StripAttributes(mozilla::OriginAttributes::STRIP_USER_CONTEXT_ID);
+ // attrs.StripAttributes(mozilla::OriginAttributes::STRIP_USER_CONTEXT_ID);
}

nsAutoCString originNoSuffix;
diff --git a/extensions/permissions/PermissionManager.cpp b/extensions/permissions/PermissionManager.cpp
index 36665fad7de7c26c9f7ccce96448868524c5a330..2af744c0c6a7739c702ba6a770a04595292d8356 100644
--- a/extensions/permissions/PermissionManager.cpp
+++ b/extensions/permissions/PermissionManager.cpp
@@ -195,7 +195,7 @@ void MaybeStripOAs(bool aForceStrip, OriginAttributes& aOriginAttributes) {
}

if (flags != 0) {
- aOriginAttributes.StripAttributes(flags);
+ // aOriginAttributes.StripAttributes(flags);
}
}

@@ -228,6 +228,8 @@ nsresult GetOriginFromPrincipal(nsIPrincipal* aPrincipal, bool aForceStripOA,

OriginAppendOASuffix(attrs, aForceStripOA, aOrigin);

+ // Disable userContext for permissions.
+ // attrs.StripAttributes(mozilla::OriginAttributes::STRIP_USER_CONTEXT_ID);
return NS_OK;
}

diff --git a/js/public/Date.h b/js/public/Date.h
index e7a54d86c44499a3ec2adf1c156b9f9dfb0bc6b4..f56c1b419c4cb52bc371f6b8dbfffba464326fc4 100644
--- a/js/public/Date.h
Expand Down
3 changes: 3 additions & 0 deletions browser_patches/firefox/preferences/playwright.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ pref("dom.ipc.processCount", 60000);
// Do not use system colors - they are affected by themes.
pref("ui.use_standins_for_native_colors", true);

// Isolate permissions by user context.
pref("permissions.isolateBy.userContext", true);

pref("dom.push.serverURL", "");
pref("services.settings.server", "");
pref("browser.safebrowsing.provider.mozilla.updateURL", "");
Expand Down

0 comments on commit 082bb3c

Please sign in to comment.