diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-30 23:58:51 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-30 23:58:51 +0200 |
commit | a0643b997c05e2b72456d184e4ec9e0f78a34578 (patch) | |
tree | 0fb89dde35ae36e42b30718f33f0ae556e47b0ad | |
parent | 8dcc716efdf415611f09e30f213342a484c70150 (diff) | |
download | uxp-a0643b997c05e2b72456d184e4ec9e0f78a34578.tar.gz |
Bug 1348801: Teach TriggeringPrincipal about OA when opening link in private window
-rw-r--r-- | browser/base/content/utilityOverlay.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index 6ceaf773ea..97897c78cb 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -259,6 +259,19 @@ function openLinkIn(url, where, params) { return; } + // Teach the principal about the right OA to use, e.g. in case when + // opening a link in a new private window, or in a new container tab. + // Please note we do not have to do that for SystemPrincipals and we + // can not do it for NullPrincipals since NullPrincipals are only + // identical if they actually are the same object (See Bug: 1346759) + if (aPrincipal && aPrincipal.isCodebasePrincipal) { + let attrs = { + userContextId: aUserContextId, + privateBrowsingId: aIsPrivate || (w && PrivateBrowsingUtils.isWindowPrivate(w)), + }; + aPrincipal = Services.scriptSecurityManager.createCodebasePrincipal(aPrincipal.URI, attrs); + } + if (!w || where == "window") { // Strip referrer data when opening a new private window, to prevent // regular browsing data from leaking into it. |