зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset c9b0ce46ad4f (bug 1466801) for pause-remove-from-document-networkState.html failures CLOSED TREE
--HG-- rename : browser/base/content/test/contextMenu/browser_utilityOverlay.js => browser/base/content/test/general/browser_utilityOverlay.js
This commit is contained in:
Родитель
d4b83a4a08
Коммит
89268618f4
|
@ -1695,10 +1695,7 @@ var gBrowserInit = {
|
||||||
window.arguments[4] || false, referrerPolicy, userContextId,
|
window.arguments[4] || false, referrerPolicy, userContextId,
|
||||||
// pass the origin principal (if any) and force its use to create
|
// pass the origin principal (if any) and force its use to create
|
||||||
// an initial about:blank viewer if present:
|
// an initial about:blank viewer if present:
|
||||||
window.arguments[7], !!window.arguments[7], window.arguments[8],
|
window.arguments[7], !!window.arguments[7], window.arguments[8]);
|
||||||
// TODO fix allowInheritPrincipal
|
|
||||||
// (this is required by javascript: drop to the new window) Bug 1475201
|
|
||||||
true);
|
|
||||||
window.focus();
|
window.focus();
|
||||||
} else {
|
} else {
|
||||||
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
|
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
|
||||||
|
@ -2387,7 +2384,7 @@ function BrowserTryToCloseWindow() {
|
||||||
|
|
||||||
function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
|
function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
|
||||||
userContextId, originPrincipal, forceAboutBlankViewerInCurrent,
|
userContextId, originPrincipal, forceAboutBlankViewerInCurrent,
|
||||||
triggeringPrincipal, allowInheritPrincipal = false) {
|
triggeringPrincipal) {
|
||||||
try {
|
try {
|
||||||
openLinkIn(uri, "current",
|
openLinkIn(uri, "current",
|
||||||
{ referrerURI: referrer,
|
{ referrerURI: referrer,
|
||||||
|
@ -2398,7 +2395,6 @@ function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
|
||||||
originPrincipal,
|
originPrincipal,
|
||||||
triggeringPrincipal,
|
triggeringPrincipal,
|
||||||
forceAboutBlankViewerInCurrent,
|
forceAboutBlankViewerInCurrent,
|
||||||
allowInheritPrincipal,
|
|
||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
@ -3567,9 +3563,6 @@ var newTabButtonObserver = {
|
||||||
let data = await getShortcutOrURIAndPostData(link.url);
|
let data = await getShortcutOrURIAndPostData(link.url);
|
||||||
// Allow third-party services to fixup this URL.
|
// Allow third-party services to fixup this URL.
|
||||||
openNewTabWith(data.url, shiftKey, {
|
openNewTabWith(data.url, shiftKey, {
|
||||||
// TODO fix allowInheritPrincipal
|
|
||||||
// (this is required by javascript: drop to the new window) Bug 1475201
|
|
||||||
allowInheritPrincipal: true,
|
|
||||||
postData: data.postData,
|
postData: data.postData,
|
||||||
allowThirdPartyFixup: true,
|
allowThirdPartyFixup: true,
|
||||||
triggeringPrincipal,
|
triggeringPrincipal,
|
||||||
|
@ -3602,9 +3595,6 @@ var newWindowButtonObserver = {
|
||||||
let data = await getShortcutOrURIAndPostData(link.url);
|
let data = await getShortcutOrURIAndPostData(link.url);
|
||||||
// Allow third-party services to fixup this URL.
|
// Allow third-party services to fixup this URL.
|
||||||
openNewWindowWith(data.url, {
|
openNewWindowWith(data.url, {
|
||||||
// TODO fix allowInheritPrincipal
|
|
||||||
// (this is required by javascript: drop to the new window) Bug 1475201
|
|
||||||
allowInheritPrincipal: true,
|
|
||||||
postData: data.postData,
|
postData: data.postData,
|
||||||
allowThirdPartyFixup: true,
|
allowThirdPartyFixup: true,
|
||||||
triggeringPrincipal,
|
triggeringPrincipal,
|
||||||
|
@ -6106,7 +6096,7 @@ function middleMousePaste(event) {
|
||||||
lastLocationChange == gBrowser.selectedBrowser.lastLocationChange) {
|
lastLocationChange == gBrowser.selectedBrowser.lastLocationChange) {
|
||||||
openUILink(data.url, event,
|
openUILink(data.url, event,
|
||||||
{ ignoreButton: true,
|
{ ignoreButton: true,
|
||||||
allowInheritPrincipal: data.mayInheritPrincipal,
|
disallowInheritPrincipal: !data.mayInheritPrincipal,
|
||||||
triggeringPrincipal: gBrowser.selectedBrowser.contentPrincipal,
|
triggeringPrincipal: gBrowser.selectedBrowser.contentPrincipal,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -855,6 +855,7 @@ nsContextMenu.prototype = {
|
||||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||||
let referrer = gContextMenuContentData.referrer;
|
let referrer = gContextMenuContentData.referrer;
|
||||||
openWebLinkIn(gContextMenuContentData.docLocation, "current", {
|
openWebLinkIn(gContextMenuContentData.docLocation, "current", {
|
||||||
|
disallowInheritPrincipal: true,
|
||||||
referrerURI: referrer ? makeURI(referrer) : null,
|
referrerURI: referrer ? makeURI(referrer) : null,
|
||||||
triggeringPrincipal: this.browser.contentPrincipal,
|
triggeringPrincipal: this.browser.contentPrincipal,
|
||||||
});
|
});
|
||||||
|
@ -912,7 +913,8 @@ nsContextMenu.prototype = {
|
||||||
urlSecurityCheck(this.imageDescURL,
|
urlSecurityCheck(this.imageDescURL,
|
||||||
this.principal,
|
this.principal,
|
||||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||||
openUILink(this.imageDescURL, e, { referrerURI: gContextMenuContentData.documentURIObject,
|
openUILink(this.imageDescURL, e, { disallowInheritPrincipal: true,
|
||||||
|
referrerURI: gContextMenuContentData.documentURIObject,
|
||||||
triggeringPrincipal: this.principal,
|
triggeringPrincipal: this.principal,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -950,14 +952,16 @@ nsContextMenu.prototype = {
|
||||||
let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||||
if (this.onCanvas) {
|
if (this.onCanvas) {
|
||||||
this._canvasToBlobURL(this.target).then(function(blobURL) {
|
this._canvasToBlobURL(this.target).then(function(blobURL) {
|
||||||
openUILink(blobURL, e, { referrerURI,
|
openUILink(blobURL, e, { disallowInheritPrincipal: true,
|
||||||
|
referrerURI,
|
||||||
triggeringPrincipal: systemPrincipal});
|
triggeringPrincipal: systemPrincipal});
|
||||||
}, Cu.reportError);
|
}, Cu.reportError);
|
||||||
} else {
|
} else {
|
||||||
urlSecurityCheck(this.mediaURL,
|
urlSecurityCheck(this.mediaURL,
|
||||||
this.principal,
|
this.principal,
|
||||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||||
openUILink(this.mediaURL, e, { referrerURI,
|
openUILink(this.mediaURL, e, { disallowInheritPrincipal: true,
|
||||||
|
referrerURI,
|
||||||
forceAllowDataURI: true,
|
forceAllowDataURI: true,
|
||||||
triggeringPrincipal: this.principal,
|
triggeringPrincipal: this.principal,
|
||||||
});
|
});
|
||||||
|
@ -1014,7 +1018,8 @@ nsContextMenu.prototype = {
|
||||||
this.principal,
|
this.principal,
|
||||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||||
|
|
||||||
openUILink(this.bgImageURL, e, { referrerURI: gContextMenuContentData.documentURIObject,
|
openUILink(this.bgImageURL, e, { disallowInheritPrincipal: true,
|
||||||
|
referrerURI: gContextMenuContentData.documentURIObject,
|
||||||
triggeringPrincipal: this.principal,
|
triggeringPrincipal: this.principal,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -1330,7 +1330,6 @@ window._gBrowser = {
|
||||||
var aReferrerPolicy;
|
var aReferrerPolicy;
|
||||||
var aFromExternal;
|
var aFromExternal;
|
||||||
var aRelatedToCurrent;
|
var aRelatedToCurrent;
|
||||||
var aAllowInheritPrincipal;
|
|
||||||
var aAllowMixedContent;
|
var aAllowMixedContent;
|
||||||
var aSkipAnimation;
|
var aSkipAnimation;
|
||||||
var aForceNotRemote;
|
var aForceNotRemote;
|
||||||
|
@ -1358,7 +1357,6 @@ window._gBrowser = {
|
||||||
aAllowThirdPartyFixup = params.allowThirdPartyFixup;
|
aAllowThirdPartyFixup = params.allowThirdPartyFixup;
|
||||||
aFromExternal = params.fromExternal;
|
aFromExternal = params.fromExternal;
|
||||||
aRelatedToCurrent = params.relatedToCurrent;
|
aRelatedToCurrent = params.relatedToCurrent;
|
||||||
aAllowInheritPrincipal = !!params.allowInheritPrincipal;
|
|
||||||
aAllowMixedContent = params.allowMixedContent;
|
aAllowMixedContent = params.allowMixedContent;
|
||||||
aSkipAnimation = params.skipAnimation;
|
aSkipAnimation = params.skipAnimation;
|
||||||
aForceNotRemote = params.forceNotRemote;
|
aForceNotRemote = params.forceNotRemote;
|
||||||
|
@ -1391,7 +1389,6 @@ window._gBrowser = {
|
||||||
charset: aCharset,
|
charset: aCharset,
|
||||||
postData: aPostData,
|
postData: aPostData,
|
||||||
ownerTab: owner,
|
ownerTab: owner,
|
||||||
allowInheritPrincipal: aAllowInheritPrincipal,
|
|
||||||
allowThirdPartyFixup: aAllowThirdPartyFixup,
|
allowThirdPartyFixup: aAllowThirdPartyFixup,
|
||||||
fromExternal: aFromExternal,
|
fromExternal: aFromExternal,
|
||||||
relatedToCurrent: aRelatedToCurrent,
|
relatedToCurrent: aRelatedToCurrent,
|
||||||
|
@ -2168,12 +2165,12 @@ window._gBrowser = {
|
||||||
|
|
||||||
// eslint-disable-next-line complexity
|
// eslint-disable-next-line complexity
|
||||||
addTab(aURI, {
|
addTab(aURI, {
|
||||||
allowInheritPrincipal,
|
|
||||||
allowMixedContent,
|
allowMixedContent,
|
||||||
allowThirdPartyFixup,
|
allowThirdPartyFixup,
|
||||||
bulkOrderedOpen,
|
bulkOrderedOpen,
|
||||||
charset,
|
charset,
|
||||||
createLazyBrowser,
|
createLazyBrowser,
|
||||||
|
disallowInheritPrincipal,
|
||||||
eventDetail,
|
eventDetail,
|
||||||
focusUrlBar,
|
focusUrlBar,
|
||||||
forceNotRemote,
|
forceNotRemote,
|
||||||
|
@ -2475,7 +2472,7 @@ window._gBrowser = {
|
||||||
|
|
||||||
// If we didn't swap docShells with a preloaded browser
|
// If we didn't swap docShells with a preloaded browser
|
||||||
// then let's just continue loading the page normally.
|
// then let's just continue loading the page normally.
|
||||||
if (!usingPreloadedContent && (!uriIsAboutBlank || !allowInheritPrincipal)) {
|
if (!usingPreloadedContent && (!uriIsAboutBlank || disallowInheritPrincipal)) {
|
||||||
// pretend the user typed this so it'll be available till
|
// pretend the user typed this so it'll be available till
|
||||||
// the document successfully loads
|
// the document successfully loads
|
||||||
if (aURI && !gInitialPages.includes(aURI)) {
|
if (aURI && !gInitialPages.includes(aURI)) {
|
||||||
|
@ -2493,7 +2490,7 @@ window._gBrowser = {
|
||||||
if (allowMixedContent) {
|
if (allowMixedContent) {
|
||||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT;
|
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT;
|
||||||
}
|
}
|
||||||
if (!allowInheritPrincipal) {
|
if (disallowInheritPrincipal) {
|
||||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
|
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -7,5 +7,3 @@ support-files =
|
||||||
[browser_contextmenu_touch.js]
|
[browser_contextmenu_touch.js]
|
||||||
skip-if = !(os == 'win' && os_version == '10.0')
|
skip-if = !(os == 'win' && os_version == '10.0')
|
||||||
[browser_contextmenu_linkopen.js]
|
[browser_contextmenu_linkopen.js]
|
||||||
[browser_utilityOverlay.js]
|
|
||||||
[browser_utilityOverlayPrincipal.js]
|
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
const gTests = [
|
|
||||||
test_openUILink_checkPrincipal,
|
|
||||||
];
|
|
||||||
|
|
||||||
function test() {
|
|
||||||
waitForExplicitFinish();
|
|
||||||
executeSoon(runNextTest);
|
|
||||||
}
|
|
||||||
|
|
||||||
function runNextTest() {
|
|
||||||
if (gTests.length) {
|
|
||||||
let testFun = gTests.shift();
|
|
||||||
info("Running " + testFun.name);
|
|
||||||
testFun();
|
|
||||||
} else {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_openUILink_checkPrincipal() {
|
|
||||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "http://example.com/"); // remote tab
|
|
||||||
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(async function() {
|
|
||||||
is(tab.linkedBrowser.currentURI.spec, "http://example.com/", "example.com loaded");
|
|
||||||
|
|
||||||
await ContentTask.spawn(tab.linkedBrowser, null, function() {
|
|
||||||
let channel = content.docShell.currentDocumentChannel;
|
|
||||||
|
|
||||||
const loadingPrincipal = channel.loadInfo.loadingPrincipal;
|
|
||||||
is(loadingPrincipal, null, "sanity: correct loadingPrincipal");
|
|
||||||
const triggeringPrincipal = channel.loadInfo.triggeringPrincipal;
|
|
||||||
ok(Services.scriptSecurityManager.isSystemPrincipal(triggeringPrincipal),
|
|
||||||
"sanity: correct triggeringPrincipal");
|
|
||||||
const principalToInherit = channel.loadInfo.principalToInherit;
|
|
||||||
ok(principalToInherit.isNullPrincipal, "sanity: correct principalToInherit");
|
|
||||||
ok(content.document.nodePrincipal.isCodebasePrincipal,
|
|
||||||
"sanity: correct doc.nodePrincipal");
|
|
||||||
is(content.document.nodePrincipal.URI.asciiSpec, "http://example.com/",
|
|
||||||
"sanity: correct doc.nodePrincipal URL");
|
|
||||||
});
|
|
||||||
|
|
||||||
gBrowser.removeCurrentTab();
|
|
||||||
runNextTest();
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Ensure we get the correct default of "allowInheritPrincipal: false" from openUILink
|
|
||||||
openUILink("http://example.com", null, {
|
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal({}),
|
|
||||||
}); // defaults to "current"
|
|
||||||
}
|
|
|
@ -446,6 +446,8 @@ run-if = e10s
|
||||||
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
|
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
|
||||||
[browser_unloaddialogs.js]
|
[browser_unloaddialogs.js]
|
||||||
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
|
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
|
||||||
|
[browser_utilityOverlay.js]
|
||||||
|
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
|
||||||
[browser_viewSourceInTabOnViewSource.js]
|
[browser_viewSourceInTabOnViewSource.js]
|
||||||
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
|
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
|
||||||
[browser_visibleFindSelection.js]
|
[browser_visibleFindSelection.js]
|
||||||
|
|
|
@ -7,7 +7,7 @@ const gTests = [
|
||||||
test_getTopWin,
|
test_getTopWin,
|
||||||
test_getBoolPref,
|
test_getBoolPref,
|
||||||
test_openNewTabWith,
|
test_openNewTabWith,
|
||||||
test_openUILink,
|
test_openUILink
|
||||||
];
|
];
|
||||||
|
|
||||||
function test() {
|
function test() {
|
|
@ -932,7 +932,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
params.targetBrowser = browser;
|
params.targetBrowser = browser;
|
||||||
params.indicateErrorPageLoad = true;
|
params.indicateErrorPageLoad = true;
|
||||||
params.allowPinnedTabHostChange = true;
|
params.allowPinnedTabHostChange = true;
|
||||||
params.allowInheritPrincipal = mayInheritPrincipal;
|
params.disallowInheritPrincipal = !mayInheritPrincipal;
|
||||||
params.allowPopups = url.startsWith("javascript:");
|
params.allowPopups = url.startsWith("javascript:");
|
||||||
} else {
|
} else {
|
||||||
params.initiatingDoc = document;
|
params.initiatingDoc = document;
|
||||||
|
|
|
@ -282,10 +282,10 @@ function openLinkIn(url, where, params) {
|
||||||
var aReferrerPolicy = ("referrerPolicy" in params ?
|
var aReferrerPolicy = ("referrerPolicy" in params ?
|
||||||
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||||
var aRelatedToCurrent = params.relatedToCurrent;
|
var aRelatedToCurrent = params.relatedToCurrent;
|
||||||
var aAllowInheritPrincipal = !!params.allowInheritPrincipal;
|
|
||||||
var aAllowMixedContent = params.allowMixedContent;
|
var aAllowMixedContent = params.allowMixedContent;
|
||||||
var aForceAllowDataURI = params.forceAllowDataURI;
|
var aForceAllowDataURI = params.forceAllowDataURI;
|
||||||
var aInBackground = params.inBackground;
|
var aInBackground = params.inBackground;
|
||||||
|
var aDisallowInheritPrincipal = params.disallowInheritPrincipal;
|
||||||
var aInitiatingDoc = params.initiatingDoc;
|
var aInitiatingDoc = params.initiatingDoc;
|
||||||
var aIsPrivate = params.private;
|
var aIsPrivate = params.private;
|
||||||
var aSkipTabAnimation = params.skipTabAnimation;
|
var aSkipTabAnimation = params.skipTabAnimation;
|
||||||
|
@ -482,10 +482,12 @@ function openLinkIn(url, where, params) {
|
||||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
|
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL isn't supported for javascript URIs,
|
// LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL isn't supported for javascript URIs,
|
||||||
// i.e. it causes them not to load at all. Callers should strip
|
// i.e. it causes them not to load at all. Callers should strip
|
||||||
// "javascript:" from pasted strings to prevent blank tabs
|
// "javascript:" from pasted strings to protect users from malicious URIs
|
||||||
if (!aAllowInheritPrincipal) {
|
// (see stripUnsafeProtocolOnPaste).
|
||||||
|
if (aDisallowInheritPrincipal && !(uriObj && uriObj.schemeIs("javascript"))) {
|
||||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
|
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -543,7 +545,6 @@ function openLinkIn(url, where, params) {
|
||||||
userContextId: aUserContextId,
|
userContextId: aUserContextId,
|
||||||
originPrincipal: aPrincipal,
|
originPrincipal: aPrincipal,
|
||||||
triggeringPrincipal: aTriggeringPrincipal,
|
triggeringPrincipal: aTriggeringPrincipal,
|
||||||
allowInheritPrincipal: aAllowInheritPrincipal,
|
|
||||||
focusUrlBar,
|
focusUrlBar,
|
||||||
});
|
});
|
||||||
targetBrowser = tabUsedForLoad.linkedBrowser;
|
targetBrowser = tabUsedForLoad.linkedBrowser;
|
||||||
|
|
|
@ -572,7 +572,7 @@ this.tabs = class extends ExtensionAPI {
|
||||||
} else {
|
} else {
|
||||||
url = window.BROWSER_NEW_TAB_URL;
|
url = window.BROWSER_NEW_TAB_URL;
|
||||||
}
|
}
|
||||||
// Only set allowInheritPrincipal on discardable urls as it
|
// Only set disallowInheritPrincipal on non-discardable urls as it
|
||||||
// will override creating a lazy browser. Setting triggeringPrincipal
|
// will override creating a lazy browser. Setting triggeringPrincipal
|
||||||
// will ensure other cases are handled, but setting it may prevent
|
// will ensure other cases are handled, but setting it may prevent
|
||||||
// creating about and data urls.
|
// creating about and data urls.
|
||||||
|
@ -580,15 +580,12 @@ this.tabs = class extends ExtensionAPI {
|
||||||
if (!discardable) {
|
if (!discardable) {
|
||||||
// Make sure things like about:blank and data: URIs never inherit,
|
// Make sure things like about:blank and data: URIs never inherit,
|
||||||
// and instead always get a NullPrincipal.
|
// and instead always get a NullPrincipal.
|
||||||
options.allowInheritPrincipal = false;
|
options.disallowInheritPrincipal = true;
|
||||||
// Falling back to codebase here as about: requires it, however is safe.
|
// Falling back to codebase here as about: requires it, however is safe.
|
||||||
principal = Services.scriptSecurityManager.createCodebasePrincipal(Services.io.newURI(url), {
|
principal = Services.scriptSecurityManager.createCodebasePrincipal(Services.io.newURI(url), {
|
||||||
userContextId: options.userContextId,
|
userContextId: options.userContextId,
|
||||||
privateBrowsingId: PrivateBrowsingUtils.isBrowserPrivate(window.gBrowser) ? 1 : 0,
|
privateBrowsingId: PrivateBrowsingUtils.isBrowserPrivate(window.gBrowser) ? 1 : 0,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
options.allowInheritPrincipal = true;
|
|
||||||
options.triggeringPrincipal = context.principal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tabListener.initTabReady();
|
tabListener.initTabReady();
|
||||||
|
|
|
@ -3498,7 +3498,6 @@ var SessionStoreInternal = {
|
||||||
tab = tabbrowser.addTrustedTab(url,
|
tab = tabbrowser.addTrustedTab(url,
|
||||||
{ createLazyBrowser,
|
{ createLazyBrowser,
|
||||||
skipAnimation: true,
|
skipAnimation: true,
|
||||||
allowInheritPrincipal: true,
|
|
||||||
noInitialLabel: true,
|
noInitialLabel: true,
|
||||||
userContextId,
|
userContextId,
|
||||||
skipBackgroundNotify: true,
|
skipBackgroundNotify: true,
|
||||||
|
|
|
@ -77,8 +77,6 @@ var ContentClick = {
|
||||||
params.userContextId = json.originAttributes.userContextId;
|
params.userContextId = json.originAttributes.userContextId;
|
||||||
}
|
}
|
||||||
|
|
||||||
params.allowInheritPrincipal = true;
|
|
||||||
|
|
||||||
window.openLinkIn(json.href, where, params);
|
window.openLinkIn(json.href, where, params);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1785,9 +1785,6 @@ var BrowserTestUtils = {
|
||||||
if (!params.triggeringPrincipal) {
|
if (!params.triggeringPrincipal) {
|
||||||
params.triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
params.triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||||
}
|
}
|
||||||
if (!params.allowInheritPrincipal) {
|
|
||||||
params.allowInheritPrincipal = true;
|
|
||||||
}
|
|
||||||
if (beforeLoadFunc) {
|
if (beforeLoadFunc) {
|
||||||
let window = tabbrowser.ownerGlobal;
|
let window = tabbrowser.ownerGlobal;
|
||||||
window.addEventListener("TabOpen", function(e) {
|
window.addEventListener("TabOpen", function(e) {
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
[autoplay-with-broken-track.html]
|
[autoplay-with-broken-track.html]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
disabled:
|
|
||||||
if debug and (os == "linux") and (processor == "x86") and (bits == 32): https://bugzilla.mozilla.org/show_bug.cgi?id=1482405
|
|
||||||
[<video autoplay> with <track src="invalid://url" default=""> child]
|
[<video autoplay> with <track src="invalid://url" default=""> child]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
[<video autoplay> with <track src="" default=""> child]
|
[<video autoplay> with <track src="" default=""> child]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[event_pause_noautoplay.html]
|
|
||||||
disabled:
|
|
||||||
if debug and (os == "linux") and (processor == "x86") and (bits == 32): https://bugzilla.mozilla.org/show_bug.cgi?id=1482405
|
|
|
@ -1,3 +0,0 @@
|
||||||
[paused_true_during_pause.html]
|
|
||||||
disabled:
|
|
||||||
if debug and (os == "linux") and (processor == "x86") and (bits == 32): https://bugzilla.mozilla.org/show_bug.cgi?id=1482405
|
|
|
@ -1,3 +0,0 @@
|
||||||
[autoplay.html]
|
|
||||||
disabled:
|
|
||||||
if debug and (os == "linux") and (processor == "x86") and (bits == 32): https://bugzilla.mozilla.org/show_bug.cgi?id=1482405
|
|
Загрузка…
Ссылка в новой задаче