mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
This commit is contained in:
parent
12189bf738
commit
130a655906
@ -7,12 +7,8 @@
|
||||
/* import-globals-from ../../mochitest/layout.js */
|
||||
|
||||
async function testContentBounds(browser, acc) {
|
||||
let [
|
||||
expectedX,
|
||||
expectedY,
|
||||
expectedWidth,
|
||||
expectedHeight,
|
||||
] = await getContentBoundsForDOMElm(browser, getAccessibleDOMNodeID(acc));
|
||||
let [expectedX, expectedY, expectedWidth, expectedHeight] =
|
||||
await getContentBoundsForDOMElm(browser, getAccessibleDOMNodeID(acc));
|
||||
|
||||
let contentDPR = await getContentDPR(browser);
|
||||
let [x, y, width, height] = getBounds(acc, contentDPR);
|
||||
|
@ -131,8 +131,10 @@ addAccessibleTask(
|
||||
async function (browser, docAcc) {
|
||||
const tree = { TEXT_CONTAINER: [{ PARAGRAPH: [{ TEXT_LEAF: [] }] }] };
|
||||
|
||||
const divWithTransform = findAccessibleChildByID(docAcc, "container")
|
||||
.firstChild;
|
||||
const divWithTransform = findAccessibleChildByID(
|
||||
docAcc,
|
||||
"container"
|
||||
).firstChild;
|
||||
testAccessibleTree(divWithTransform, tree);
|
||||
// testBoundsWithContent takes an id, but divWithTransform doesn't have one,
|
||||
// so we can't test the bounds for it.
|
||||
|
@ -7,12 +7,8 @@
|
||||
/* import-globals-from ../../mochitest/layout.js */
|
||||
|
||||
async function testContentBounds(browser, acc) {
|
||||
let [
|
||||
expectedX,
|
||||
expectedY,
|
||||
expectedWidth,
|
||||
expectedHeight,
|
||||
] = await getContentBoundsForDOMElm(browser, getAccessibleDOMNodeID(acc));
|
||||
let [expectedX, expectedY, expectedWidth, expectedHeight] =
|
||||
await getContentBoundsForDOMElm(browser, getAccessibleDOMNodeID(acc));
|
||||
|
||||
let contentDPR = await getContentDPR(browser);
|
||||
let [x, y, width, height] = getBounds(acc, contentDPR);
|
||||
|
@ -32,9 +32,8 @@ add_task(async function () {
|
||||
// Create a11y service in the main process. This will trigger creating of
|
||||
// the a11y service in parent as well.
|
||||
const [parentA11yInitObserver, parentA11yInit] = initAccService();
|
||||
const [contentA11yInitObserver, contentA11yInit] = initAccService(
|
||||
browser
|
||||
);
|
||||
const [contentA11yInitObserver, contentA11yInit] =
|
||||
initAccService(browser);
|
||||
|
||||
await Promise.all([parentA11yInitObserver, contentA11yInitObserver]);
|
||||
|
||||
@ -61,10 +60,8 @@ add_task(async function () {
|
||||
// This promise will resolve only if contentCanShutdown flag is set to true.
|
||||
// If 'a11y-init-or-shutdown' event with '0' flag (in content) comes before
|
||||
// it can be shut down, the promise will reject.
|
||||
const [
|
||||
contentA11yShutdownObserver,
|
||||
contentA11yShutdownPromise,
|
||||
] = shutdownAccService(browser);
|
||||
const [contentA11yShutdownObserver, contentA11yShutdownPromise] =
|
||||
shutdownAccService(browser);
|
||||
await contentA11yShutdownObserver;
|
||||
const contentA11yShutdown = new Promise((resolve, reject) =>
|
||||
contentA11yShutdownPromise.then(flag =>
|
||||
@ -87,10 +84,8 @@ add_task(async function () {
|
||||
// Now allow a11y service to shutdown in content.
|
||||
contentCanShutdown = true;
|
||||
// Remove the a11y service reference in the main process.
|
||||
const [
|
||||
parentA11yShutdownObserver,
|
||||
parentA11yShutdown,
|
||||
] = shutdownAccService();
|
||||
const [parentA11yShutdownObserver, parentA11yShutdown] =
|
||||
shutdownAccService();
|
||||
await parentA11yShutdownObserver;
|
||||
|
||||
accService = null;
|
||||
|
@ -32,17 +32,12 @@ add_task(async function () {
|
||||
// Create a11y service in the main process. This will trigger creating of
|
||||
// the a11y service in parent as well.
|
||||
const [parentA11yInitObserver, parentA11yInit] = initAccService();
|
||||
const [contentA11yInitObserver, contentA11yInit] = initAccService(
|
||||
browser
|
||||
);
|
||||
let [
|
||||
parentConsumersChangedObserver,
|
||||
parentConsumersChanged,
|
||||
] = accConsumersChanged();
|
||||
let [
|
||||
contentConsumersChangedObserver,
|
||||
contentConsumersChanged,
|
||||
] = accConsumersChanged(browser);
|
||||
const [contentA11yInitObserver, contentA11yInit] =
|
||||
initAccService(browser);
|
||||
let [parentConsumersChangedObserver, parentConsumersChanged] =
|
||||
accConsumersChanged();
|
||||
let [contentConsumersChangedObserver, contentConsumersChanged] =
|
||||
accConsumersChanged(browser);
|
||||
|
||||
await Promise.all([
|
||||
parentA11yInitObserver,
|
||||
@ -94,22 +89,14 @@ add_task(async function () {
|
||||
"down in content"
|
||||
);
|
||||
// Remove a11y service reference in the main process.
|
||||
const [
|
||||
parentA11yShutdownObserver,
|
||||
parentA11yShutdown,
|
||||
] = shutdownAccService();
|
||||
const [
|
||||
contentA11yShutdownObserver,
|
||||
contentA11yShutdown,
|
||||
] = shutdownAccService(browser);
|
||||
[
|
||||
parentConsumersChangedObserver,
|
||||
parentConsumersChanged,
|
||||
] = accConsumersChanged();
|
||||
[
|
||||
contentConsumersChangedObserver,
|
||||
contentConsumersChanged,
|
||||
] = accConsumersChanged(browser);
|
||||
const [parentA11yShutdownObserver, parentA11yShutdown] =
|
||||
shutdownAccService();
|
||||
const [contentA11yShutdownObserver, contentA11yShutdown] =
|
||||
shutdownAccService(browser);
|
||||
[parentConsumersChangedObserver, parentConsumersChanged] =
|
||||
accConsumersChanged();
|
||||
[contentConsumersChangedObserver, contentConsumersChanged] =
|
||||
accConsumersChanged(browser);
|
||||
|
||||
await Promise.all([
|
||||
parentA11yShutdownObserver,
|
||||
|
@ -32,13 +32,10 @@ add_task(async function () {
|
||||
// Create a11y service in the main process. This will trigger creating of
|
||||
// the a11y service in parent as well.
|
||||
const [parentA11yInitObserver, parentA11yInit] = initAccService();
|
||||
const [contentA11yInitObserver, contentA11yInit] = initAccService(
|
||||
browser
|
||||
);
|
||||
let [
|
||||
contentConsumersChangedObserver,
|
||||
contentConsumersChanged,
|
||||
] = accConsumersChanged(browser);
|
||||
const [contentA11yInitObserver, contentA11yInit] =
|
||||
initAccService(browser);
|
||||
let [contentConsumersChangedObserver, contentConsumersChanged] =
|
||||
accConsumersChanged(browser);
|
||||
|
||||
await Promise.all([
|
||||
parentA11yInitObserver,
|
||||
@ -67,10 +64,8 @@ add_task(async function () {
|
||||
"Adding additional reference to accessibility service in content " +
|
||||
"process"
|
||||
);
|
||||
[
|
||||
contentConsumersChangedObserver,
|
||||
contentConsumersChanged,
|
||||
] = accConsumersChanged(browser);
|
||||
[contentConsumersChangedObserver, contentConsumersChanged] =
|
||||
accConsumersChanged(browser);
|
||||
await contentConsumersChangedObserver;
|
||||
// Add a new reference to the a11y service inside the content process.
|
||||
await SpecialPowers.spawn(browser, [], () => {
|
||||
@ -106,21 +101,15 @@ add_task(async function () {
|
||||
"content stays alive"
|
||||
);
|
||||
let contentCanShutdown = false;
|
||||
const [
|
||||
parentA11yShutdownObserver,
|
||||
parentA11yShutdown,
|
||||
] = shutdownAccService();
|
||||
[
|
||||
contentConsumersChangedObserver,
|
||||
contentConsumersChanged,
|
||||
] = accConsumersChanged(browser);
|
||||
const [parentA11yShutdownObserver, parentA11yShutdown] =
|
||||
shutdownAccService();
|
||||
[contentConsumersChangedObserver, contentConsumersChanged] =
|
||||
accConsumersChanged(browser);
|
||||
// This promise will resolve only if contentCanShutdown flag is set to true.
|
||||
// If 'a11y-init-or-shutdown' event with '0' flag (in content) comes before
|
||||
// it can be shut down, the promise will reject.
|
||||
const [
|
||||
contentA11yShutdownObserver,
|
||||
contentA11yShutdownPromise,
|
||||
] = shutdownAccService(browser);
|
||||
const [contentA11yShutdownObserver, contentA11yShutdownPromise] =
|
||||
shutdownAccService(browser);
|
||||
const contentA11yShutdown = new Promise((resolve, reject) =>
|
||||
contentA11yShutdownPromise.then(flag =>
|
||||
contentCanShutdown
|
||||
@ -164,10 +153,8 @@ add_task(async function () {
|
||||
info("Removing a service in content");
|
||||
// Now allow a11y service to shutdown in content.
|
||||
contentCanShutdown = true;
|
||||
[
|
||||
contentConsumersChangedObserver,
|
||||
contentConsumersChanged,
|
||||
] = accConsumersChanged(browser);
|
||||
[contentConsumersChangedObserver, contentConsumersChanged] =
|
||||
accConsumersChanged(browser);
|
||||
await contentConsumersChangedObserver;
|
||||
// Remove last reference to a11y service in content and force garbage
|
||||
// collection that should trigger shutdown.
|
||||
|
@ -60,8 +60,7 @@ const tests = [
|
||||
expected: "another description",
|
||||
},
|
||||
{
|
||||
desc:
|
||||
"No description change when @alt is dropped but @aria-describedby remains",
|
||||
desc: "No description change when @alt is dropped but @aria-describedby remains",
|
||||
attrs: [
|
||||
{
|
||||
attr: "alt",
|
||||
|
@ -96,8 +96,7 @@ const valueTests = [
|
||||
expected: ["hey!", 6, 0, 7, 0],
|
||||
},
|
||||
{
|
||||
desc:
|
||||
"Value should change to @aria-valuetext when @aria-valuenow is removed",
|
||||
desc: "Value should change to @aria-valuetext when @aria-valuenow is removed",
|
||||
id: "slider",
|
||||
attrs: [
|
||||
{
|
||||
|
@ -42,9 +42,8 @@ async function changeText(browser, id, value, events) {
|
||||
);
|
||||
// Change text in the subtree.
|
||||
await invokeContentTask(browser, [id, value], (contentId, contentValue) => {
|
||||
content.document.getElementById(
|
||||
contentId
|
||||
).firstChild.textContent = contentValue;
|
||||
content.document.getElementById(contentId).firstChild.textContent =
|
||||
contentValue;
|
||||
});
|
||||
let resolvedEvents = await onEvents;
|
||||
|
||||
|
@ -220,9 +220,8 @@ addAccessibleTask(
|
||||
reorderEventPromise = waitForEvent(EVENT_REORDER, iframe);
|
||||
await invokeContentTask(browser, [], () => {
|
||||
let docNode = content.document.getElementById("iframe").contentDocument;
|
||||
let inputNode = (content.window.inputNode = docNode.createElement(
|
||||
"input"
|
||||
));
|
||||
let inputNode = (content.window.inputNode =
|
||||
docNode.createElement("input"));
|
||||
docNode.documentElement.appendChild(inputNode);
|
||||
});
|
||||
event = await reorderEventPromise;
|
||||
@ -238,8 +237,9 @@ addAccessibleTask(
|
||||
|
||||
reorderEventPromise = waitForEvent(EVENT_REORDER, iframe);
|
||||
await invokeContentTask(browser, [], () => {
|
||||
let docEl = content.document.getElementById("iframe").contentDocument
|
||||
.documentElement;
|
||||
let docEl =
|
||||
content.document.getElementById("iframe").contentDocument
|
||||
.documentElement;
|
||||
// Remove aftermath of this test before next test starts.
|
||||
docEl.firstChild.remove();
|
||||
});
|
||||
|
@ -245,8 +245,7 @@ add_task(async () => {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{
|
||||
gBrowser,
|
||||
url:
|
||||
'data:text/html,<a id="exampleLink" href="https://example.com">link</a>',
|
||||
url: 'data:text/html,<a id="exampleLink" href="https://example.com">link</a>',
|
||||
},
|
||||
async browser => {
|
||||
if (!Services.search.isInitialized) {
|
||||
|
@ -78,9 +78,8 @@ function matchWebArea(expectedId, expectedInfo) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let textChangeElemID = data.AXTextChangeElement.getAttributeValue(
|
||||
"AXDOMIdentifier"
|
||||
);
|
||||
let textChangeElemID =
|
||||
data.AXTextChangeElement.getAttributeValue("AXDOMIdentifier");
|
||||
|
||||
return (
|
||||
iface.getAttributeValue("AXRole") == "AXWebArea" &&
|
||||
|
@ -34,9 +34,8 @@ function reset() {
|
||||
|
||||
async function openColorsDialog() {
|
||||
await openPreferencesViaOpenPreferencesAPI("general", { leaveOpen: true });
|
||||
const colorsButton = gBrowser.selectedBrowser.contentDocument.getElementById(
|
||||
"colors"
|
||||
);
|
||||
const colorsButton =
|
||||
gBrowser.selectedBrowser.contentDocument.getElementById("colors");
|
||||
|
||||
const dialogOpened = promiseLoadSubDialog(
|
||||
"chrome://browser/content/preferences/dialogs/colors.xhtml"
|
||||
|
@ -219,25 +219,25 @@ addAccessibleTask(
|
||||
}
|
||||
);
|
||||
|
||||
addAccessibleTask(`<div id="a"></div><div id="b"></div>`, async function (
|
||||
browser,
|
||||
accDoc
|
||||
) {
|
||||
testChildrenIds(accDoc, ["a", "b"]);
|
||||
addAccessibleTask(
|
||||
`<div id="a"></div><div id="b"></div>`,
|
||||
async function (browser, accDoc) {
|
||||
testChildrenIds(accDoc, ["a", "b"]);
|
||||
|
||||
let waitFor = {
|
||||
expected: [[EVENT_REORDER, e => e.accessible == accDoc]],
|
||||
};
|
||||
let waitFor = {
|
||||
expected: [[EVENT_REORDER, e => e.accessible == accDoc]],
|
||||
};
|
||||
|
||||
await contentSpawnMutation(browser, waitFor, function () {
|
||||
content.document.documentElement.style.display = "none";
|
||||
content.document.documentElement.getBoundingClientRect();
|
||||
content.document.body.setAttribute("aria-owns", "b a");
|
||||
content.document.documentElement.remove();
|
||||
});
|
||||
await contentSpawnMutation(browser, waitFor, function () {
|
||||
content.document.documentElement.style.display = "none";
|
||||
content.document.documentElement.getBoundingClientRect();
|
||||
content.document.body.setAttribute("aria-owns", "b a");
|
||||
content.document.documentElement.remove();
|
||||
});
|
||||
|
||||
testChildrenIds(accDoc, []);
|
||||
});
|
||||
testChildrenIds(accDoc, []);
|
||||
}
|
||||
);
|
||||
|
||||
// Don't allow ordinal child to be placed after aria-owned child (bug 1405796)
|
||||
addAccessibleTask(
|
||||
|
@ -42,9 +42,8 @@ add_task(async function testInHTTPSURIContainingPrivateThings() {
|
||||
"https://username:password@example.com/browser/toolkit/content/tests/browser/file_empty.html?query=some#ref";
|
||||
const kURLWithoutUserPass =
|
||||
"https://example.com/browser/toolkit/content/tests/browser/file_empty.html?query=some#ref";
|
||||
const waitForDocumentLoadComplete = promiseEventDocumentLoadComplete(
|
||||
kURLWithoutUserPass
|
||||
);
|
||||
const waitForDocumentLoadComplete =
|
||||
promiseEventDocumentLoadComplete(kURLWithoutUserPass);
|
||||
await BrowserTestUtils.withNewTab(kURL, async browser => {
|
||||
is(
|
||||
(await waitForDocumentLoadComplete).URL,
|
||||
|
@ -43,9 +43,8 @@ function shutdownAutoComplete() {
|
||||
function registerAutoCompleteSearch(aSearch, aDescription) {
|
||||
var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
|
||||
|
||||
var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(
|
||||
nsIUUIDGenerator
|
||||
);
|
||||
var uuidGenerator =
|
||||
Cc["@mozilla.org/uuid-generator;1"].getService(nsIUUIDGenerator);
|
||||
var cid = uuidGenerator.generateUUID();
|
||||
|
||||
var componentManager = Components.manager.QueryInterface(
|
||||
|
@ -119,12 +119,13 @@ function openBrowserWindowIntl() {
|
||||
}
|
||||
}
|
||||
|
||||
gBrowserContext.browserWnd = window.browsingContext.topChromeWindow.openDialog(
|
||||
AppConstants.BROWSER_CHROME_URL,
|
||||
"_blank",
|
||||
params,
|
||||
gBrowserContext.startURL || "data:text/html,<html></html>"
|
||||
);
|
||||
gBrowserContext.browserWnd =
|
||||
window.browsingContext.topChromeWindow.openDialog(
|
||||
AppConstants.BROWSER_CHROME_URL,
|
||||
"_blank",
|
||||
params,
|
||||
gBrowserContext.startURL || "data:text/html,<html></html>"
|
||||
);
|
||||
|
||||
whenDelayedStartupFinished(browserWindow(), function () {
|
||||
addA11yLoadEvent(startBrowserTests, browserWindow());
|
||||
|
@ -524,8 +524,9 @@ function testAccessibleTree(aAccOrElmOrID, aAccTree, aFlags) {
|
||||
}
|
||||
|
||||
if (prevOffset != -1) {
|
||||
var charCount = getAccessible(acc, [nsIAccessibleText])
|
||||
.characterCount;
|
||||
var charCount = getAccessible(acc, [
|
||||
nsIAccessibleText,
|
||||
]).characterCount;
|
||||
let attrs = accTree[prop][prevOffset];
|
||||
testTextAttrs(
|
||||
acc,
|
||||
|
@ -493,31 +493,30 @@ function eventQueue(aEventType) {
|
||||
}
|
||||
};
|
||||
|
||||
this.processNextInvokerInTimeout = function eventQueue_processNextInvokerInTimeout(
|
||||
aUncondProcess
|
||||
) {
|
||||
this.setInvokerStatus(kInvokerPending, "Process next invoker in timeout");
|
||||
this.processNextInvokerInTimeout =
|
||||
function eventQueue_processNextInvokerInTimeout(aUncondProcess) {
|
||||
this.setInvokerStatus(kInvokerPending, "Process next invoker in timeout");
|
||||
|
||||
// No need to wait extra timeout when a) we know we don't need to do that
|
||||
// and b) there's no any single unexpected event.
|
||||
if (!aUncondProcess && this.areAllEventsExpected()) {
|
||||
// We need delay to avoid events coalesce from different invokers.
|
||||
var queue = this;
|
||||
SimpleTest.executeSoon(function () {
|
||||
queue.processNextInvoker();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// No need to wait extra timeout when a) we know we don't need to do that
|
||||
// and b) there's no any single unexpected event.
|
||||
if (!aUncondProcess && this.areAllEventsExpected()) {
|
||||
// We need delay to avoid events coalesce from different invokers.
|
||||
var queue = this;
|
||||
SimpleTest.executeSoon(function () {
|
||||
queue.processNextInvoker();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Check in timeout invoker didn't fire registered events.
|
||||
window.setTimeout(
|
||||
function (aQueue) {
|
||||
aQueue.processNextInvoker();
|
||||
},
|
||||
300,
|
||||
this
|
||||
);
|
||||
};
|
||||
// Check in timeout invoker didn't fire registered events.
|
||||
window.setTimeout(
|
||||
function (aQueue) {
|
||||
aQueue.processNextInvoker();
|
||||
},
|
||||
300,
|
||||
this
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle events for the current invoker.
|
||||
@ -755,31 +754,31 @@ function eventQueue(aEventType) {
|
||||
return true;
|
||||
};
|
||||
|
||||
this.isUnexpectedEventScenario = function eventQueue_isUnexpectedEventsScenario(
|
||||
aScenario
|
||||
) {
|
||||
for (var idx = 0; idx < aScenario.length; idx++) {
|
||||
if (!aScenario[idx].unexpected && !aScenario[idx].todo) {
|
||||
break;
|
||||
this.isUnexpectedEventScenario =
|
||||
function eventQueue_isUnexpectedEventsScenario(aScenario) {
|
||||
for (var idx = 0; idx < aScenario.length; idx++) {
|
||||
if (!aScenario[idx].unexpected && !aScenario[idx].todo) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return idx == aScenario.length;
|
||||
};
|
||||
return idx == aScenario.length;
|
||||
};
|
||||
|
||||
this.hasUnexpectedEventsScenario = function eventQueue_hasUnexpectedEventsScenario() {
|
||||
if (this.getInvoker().noEventsOnAction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
|
||||
if (this.isUnexpectedEventScenario(this.mScenarios[scnIdx])) {
|
||||
this.hasUnexpectedEventsScenario =
|
||||
function eventQueue_hasUnexpectedEventsScenario() {
|
||||
if (this.getInvoker().noEventsOnAction) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
|
||||
if (this.isUnexpectedEventScenario(this.mScenarios[scnIdx])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
this.hasMatchedScenario = function eventQueue_hasMatchedScenario() {
|
||||
for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
|
||||
@ -1498,7 +1497,8 @@ function synthFocus(aNodeOrID, aCheckerOrEventSeq) {
|
||||
|
||||
this.invoke = function synthFocus_invoke() {
|
||||
if (this.DOMNode.editor) {
|
||||
this.DOMNode.selectionStart = this.DOMNode.selectionEnd = this.DOMNode.value.length;
|
||||
this.DOMNode.selectionStart = this.DOMNode.selectionEnd =
|
||||
this.DOMNode.value.length;
|
||||
}
|
||||
this.DOMNode.focus();
|
||||
};
|
||||
|
@ -192,9 +192,8 @@ export class AboutProtectionsParent extends JSWindowActorParent {
|
||||
// if the Primary Password isn't locked.
|
||||
if (userFacingLogins && Services.logins.isLoggedIn) {
|
||||
const logins = await lazy.LoginHelper.getAllUserFacingLogins();
|
||||
potentiallyBreachedLogins = await lazy.LoginBreaches.getPotentialBreachesByLoginGUID(
|
||||
logins
|
||||
);
|
||||
potentiallyBreachedLogins =
|
||||
await lazy.LoginBreaches.getPotentialBreachesByLoginGUID(logins);
|
||||
}
|
||||
|
||||
let mobileDeviceConnected =
|
||||
@ -385,7 +384,8 @@ export class AboutProtectionsParent extends JSWindowActorParent {
|
||||
return dataToSend;
|
||||
}
|
||||
let sumEvents = await lazy.TrackingDBService.sumAllEvents();
|
||||
let earliestDate = await lazy.TrackingDBService.getEarliestRecordedDate();
|
||||
let earliestDate =
|
||||
await lazy.TrackingDBService.getEarliestRecordedDate();
|
||||
let eventsByDate = await lazy.TrackingDBService.getEventsByDateRange(
|
||||
aMessage.data.from,
|
||||
aMessage.data.to
|
||||
|
@ -145,9 +145,8 @@ export class AboutReaderParent extends JSWindowActorParent {
|
||||
uri,
|
||||
iconUri => {
|
||||
if (iconUri) {
|
||||
iconUri = lazy.PlacesUtils.favicons.getFaviconLinkForIcon(
|
||||
iconUri
|
||||
);
|
||||
iconUri =
|
||||
lazy.PlacesUtils.favicons.getFaviconLinkForIcon(iconUri);
|
||||
resolve({
|
||||
url: message.data.url,
|
||||
faviconUrl: iconUri.pathQueryRef.replace(/^favicon:/, ""),
|
||||
|
@ -81,11 +81,8 @@ export class ClickHandlerChild extends JSWindowActorChild {
|
||||
return;
|
||||
}
|
||||
|
||||
let [
|
||||
href,
|
||||
node,
|
||||
principal,
|
||||
] = lazy.BrowserUtils.hrefAndLinkNodeForClickEvent(event);
|
||||
let [href, node, principal] =
|
||||
lazy.BrowserUtils.hrefAndLinkNodeForClickEvent(event);
|
||||
|
||||
let csp = ownerDoc.csp;
|
||||
if (csp) {
|
||||
|
@ -125,9 +125,8 @@ export let ContentSearch = {
|
||||
];
|
||||
|
||||
for (let name of stringNames) {
|
||||
this._searchSuggestionUIStrings[name] = searchBundle.GetStringFromName(
|
||||
name
|
||||
);
|
||||
this._searchSuggestionUIStrings[name] =
|
||||
searchBundle.GetStringFromName(name);
|
||||
}
|
||||
return this._searchSuggestionUIStrings;
|
||||
},
|
||||
@ -242,9 +241,8 @@ export let ContentSearch = {
|
||||
postData: submission.postData,
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal(
|
||||
{
|
||||
userContextId: win.gBrowser.selectedBrowser.getAttribute(
|
||||
"userContextId"
|
||||
),
|
||||
userContextId:
|
||||
win.gBrowser.selectedBrowser.getAttribute("userContextId"),
|
||||
}
|
||||
),
|
||||
});
|
||||
@ -363,9 +361,8 @@ export let ContentSearch = {
|
||||
}
|
||||
|
||||
if (window) {
|
||||
state.isInPrivateBrowsingMode = lazy.PrivateBrowsingUtils.isContentWindowPrivate(
|
||||
window
|
||||
);
|
||||
state.isInPrivateBrowsingMode =
|
||||
lazy.PrivateBrowsingUtils.isContentWindowPrivate(window);
|
||||
state.isAboutPrivateBrowsing =
|
||||
window.gBrowser.currentURI.spec == "about:privatebrowsing";
|
||||
}
|
||||
@ -595,9 +592,12 @@ export let ContentSearch = {
|
||||
xhr.onload = () => {
|
||||
resolve(xhr.response);
|
||||
};
|
||||
xhr.onerror = xhr.onabort = xhr.ontimeout = () => {
|
||||
resolve(SEARCH_ENGINE_PLACEHOLDER_ICON);
|
||||
};
|
||||
xhr.onerror =
|
||||
xhr.onabort =
|
||||
xhr.ontimeout =
|
||||
() => {
|
||||
resolve(SEARCH_ENGINE_PLACEHOLDER_ICON);
|
||||
};
|
||||
try {
|
||||
// This throws if the URI is erroneously encoded.
|
||||
xhr.send();
|
||||
|
@ -686,9 +686,8 @@ export class ContextMenuChild extends JSWindowActorChild {
|
||||
}
|
||||
|
||||
if (linkReferrerInfo) {
|
||||
data.linkReferrerInfo = lazy.E10SUtils.serializeReferrerInfo(
|
||||
linkReferrerInfo
|
||||
);
|
||||
data.linkReferrerInfo =
|
||||
lazy.E10SUtils.serializeReferrerInfo(linkReferrerInfo);
|
||||
}
|
||||
|
||||
// Notify observers (currently only webextensions) of the context menu being
|
||||
|
@ -94,9 +94,8 @@ export class PageInfoChild extends JSWindowActorChild {
|
||||
documentURIObject.spec = document.documentURIObject.spec;
|
||||
docInfo.documentURIObject = documentURIObject;
|
||||
|
||||
docInfo.isContentWindowPrivate = lazy.PrivateBrowsingUtils.isContentWindowPrivate(
|
||||
document.ownerGlobal
|
||||
);
|
||||
docInfo.isContentWindowPrivate =
|
||||
lazy.PrivateBrowsingUtils.isContentWindowPrivate(document.ownerGlobal);
|
||||
|
||||
return docInfo;
|
||||
}
|
||||
|
@ -38,9 +38,8 @@ export class PageStyleParent extends JSWindowActorParent {
|
||||
}
|
||||
|
||||
// We always store information at the top of the frame tree.
|
||||
let actor = this.browsingContext.top.currentWindowGlobal.getActor(
|
||||
"PageStyle"
|
||||
);
|
||||
let actor =
|
||||
this.browsingContext.top.currentWindowGlobal.getActor("PageStyle");
|
||||
switch (msg.name) {
|
||||
case "PageStyle:Add":
|
||||
actor.addSheetInfo(msg.data);
|
||||
|
@ -72,8 +72,8 @@ export class PluginChild extends JSWindowActorChild {
|
||||
}
|
||||
|
||||
let { target, gmpPlugin, pluginID } = aEvent;
|
||||
let fullScreenElement = this.contentWindow.top.document
|
||||
.mozFullScreenElement;
|
||||
let fullScreenElement =
|
||||
this.contentWindow.top.document.mozFullScreenElement;
|
||||
if (fullScreenElement) {
|
||||
if (this.isWithinFullScreenElement(fullScreenElement, target)) {
|
||||
this.contentWindow.top.document.mozCancelFullScreen();
|
||||
|
@ -131,9 +131,8 @@ export class PluginParent extends JSWindowActorParent {
|
||||
showPluginCrashedNotification(browser, pluginCrashID) {
|
||||
// If there's already an existing notification bar, don't do anything.
|
||||
let notificationBox = browser.getTabBrowser().getNotificationBox(browser);
|
||||
let notification = notificationBox.getNotificationWithValue(
|
||||
"plugin-crashed"
|
||||
);
|
||||
let notification =
|
||||
notificationBox.getNotificationWithValue("plugin-crashed");
|
||||
|
||||
let report = PluginManager.getCrashReport(pluginCrashID);
|
||||
if (notification || !report) {
|
||||
|
@ -674,9 +674,8 @@ class SearchAdImpression {
|
||||
* and adsHidden, the number of ads not visible to the user.
|
||||
*/
|
||||
#countVisibleAndHiddenAds(element, adsLoaded, childElements) {
|
||||
let elementRect = element.ownerGlobal.windowUtils.getBoundsWithoutFlushing(
|
||||
element
|
||||
);
|
||||
let elementRect =
|
||||
element.ownerGlobal.windowUtils.getBoundsWithoutFlushing(element);
|
||||
|
||||
// If the element lacks a dimension, assume all ads that
|
||||
// were contained within it are hidden.
|
||||
@ -705,9 +704,8 @@ class SearchAdImpression {
|
||||
let adsVisible = 0;
|
||||
let adsHidden = 0;
|
||||
for (let child of childElements) {
|
||||
let itemRect = child.ownerGlobal.windowUtils.getBoundsWithoutFlushing(
|
||||
child
|
||||
);
|
||||
let itemRect =
|
||||
child.ownerGlobal.windowUtils.getBoundsWithoutFlushing(child);
|
||||
|
||||
// If the child element we're inspecting has no dimension, it is hidden.
|
||||
if (itemRect.height == 0 || itemRect.width == 0) {
|
||||
@ -769,9 +767,8 @@ class SearchAdImpression {
|
||||
if (this.#elementToAdDataMap.has(element)) {
|
||||
let recordedValues = this.#elementToAdDataMap.get(element);
|
||||
if (childElements.length) {
|
||||
recordedValues.childElements = recordedValues.childElements.concat(
|
||||
childElements
|
||||
);
|
||||
recordedValues.childElements =
|
||||
recordedValues.childElements.concat(childElements);
|
||||
}
|
||||
} else {
|
||||
this.#elementToAdDataMap.set(element, {
|
||||
@ -932,10 +929,8 @@ export class SearchSERPTelemetryChild extends JSWindowActorChild {
|
||||
});
|
||||
};
|
||||
let start = Cu.now();
|
||||
let {
|
||||
componentToVisibilityMap,
|
||||
hrefToComponentMap,
|
||||
} = searchAdImpression.categorize(anchors, doc);
|
||||
let { componentToVisibilityMap, hrefToComponentMap } =
|
||||
searchAdImpression.categorize(anchors, doc);
|
||||
ChromeUtils.addProfilerMarker(
|
||||
"SearchSERPTelemetryChild._checkForAdLink",
|
||||
start,
|
||||
|
@ -387,9 +387,10 @@ function prompt(
|
||||
// nsIContentPermissionRequest, but because webrtc uses their own prompting
|
||||
// system, we should manually apply the delegate policy here. Permission
|
||||
// should be delegated using Feature Policy and top principal
|
||||
const permDelegateHandler = aContentWindow.document.permDelegateHandler.QueryInterface(
|
||||
Ci.nsIPermissionDelegateHandler
|
||||
);
|
||||
const permDelegateHandler =
|
||||
aContentWindow.document.permDelegateHandler.QueryInterface(
|
||||
Ci.nsIPermissionDelegateHandler
|
||||
);
|
||||
|
||||
const shouldDelegatePermission =
|
||||
permDelegateHandler.permissionDelegateFPEnabled;
|
||||
|
@ -504,9 +504,10 @@ function prompt(aActor, aBrowser, aRequest) {
|
||||
requestTypes,
|
||||
} = aRequest;
|
||||
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
aRequest.origin
|
||||
);
|
||||
let principal =
|
||||
Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
aRequest.origin
|
||||
);
|
||||
|
||||
// For add-on principals, we immediately check for permission instead
|
||||
// of waiting for the notification to focus. This allows for supporting
|
||||
@ -964,7 +965,8 @@ function prompt(aActor, aBrowser, aRequest) {
|
||||
}
|
||||
|
||||
let perms = Services.perms;
|
||||
let chromePrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
let chromePrincipal =
|
||||
Services.scriptSecurityManager.getSystemPrincipal();
|
||||
perms.addFromPrincipal(
|
||||
chromePrincipal,
|
||||
"MediaManagerVideo",
|
||||
|
@ -66,17 +66,14 @@ var gTabsPanel = {
|
||||
let containersEnabled =
|
||||
Services.prefs.getBoolPref("privacy.userContext.enabled") &&
|
||||
!PrivateBrowsingUtils.isWindowPrivate(window);
|
||||
document.getElementById(
|
||||
"allTabsMenu-containerTabsButton"
|
||||
).hidden = !containersEnabled;
|
||||
document.getElementById("allTabsMenu-containerTabsButton").hidden =
|
||||
!containersEnabled;
|
||||
|
||||
let hasHiddenTabs = gBrowser.visibleTabs.length < gBrowser.tabs.length;
|
||||
document.getElementById(
|
||||
"allTabsMenu-hiddenTabsButton"
|
||||
).hidden = !hasHiddenTabs;
|
||||
document.getElementById(
|
||||
"allTabsMenu-hiddenTabsSeparator"
|
||||
).hidden = !hasHiddenTabs;
|
||||
document.getElementById("allTabsMenu-hiddenTabsButton").hidden =
|
||||
!hasHiddenTabs;
|
||||
document.getElementById("allTabsMenu-hiddenTabsSeparator").hidden =
|
||||
!hasHiddenTabs;
|
||||
});
|
||||
|
||||
this.allTabsView.addEventListener("ViewShown", e =>
|
||||
@ -85,9 +82,8 @@ var gTabsPanel = {
|
||||
?.scrollIntoView({ block: "center" })
|
||||
);
|
||||
|
||||
let containerTabsMenuSeparator = this.containerTabsView.querySelector(
|
||||
"toolbarseparator"
|
||||
);
|
||||
let containerTabsMenuSeparator =
|
||||
this.containerTabsView.querySelector("toolbarseparator");
|
||||
this.containerTabsView.addEventListener("ViewShowing", e => {
|
||||
let elements = [];
|
||||
let frag = document.createDocumentFragment();
|
||||
|
@ -720,9 +720,8 @@ var ctrlTab = {
|
||||
break;
|
||||
case "popupshowing":
|
||||
if (event.target.id == "menu_viewPopup") {
|
||||
document.getElementById(
|
||||
"menu_showAllTabs"
|
||||
).hidden = !gTabsPanel.canOpen;
|
||||
document.getElementById("menu_showAllTabs").hidden =
|
||||
!gTabsPanel.canOpen;
|
||||
}
|
||||
break;
|
||||
case "mouseover":
|
||||
|
@ -297,9 +297,8 @@ var FullScreen = {
|
||||
|
||||
get fullScreenToggler() {
|
||||
delete this.fullScreenToggler;
|
||||
return (this.fullScreenToggler = document.getElementById(
|
||||
"fullscr-toggler"
|
||||
));
|
||||
return (this.fullScreenToggler =
|
||||
document.getElementById("fullscr-toggler"));
|
||||
},
|
||||
|
||||
toggle() {
|
||||
|
@ -459,13 +459,11 @@ var gGestureSupport = {
|
||||
* @param aDir
|
||||
* The direction for the swipe event
|
||||
*/
|
||||
_coordinateSwipeEventWithAnimation: function GS__coordinateSwipeEventWithAnimation(
|
||||
aEvent,
|
||||
aDir
|
||||
) {
|
||||
gHistorySwipeAnimation.stopAnimation();
|
||||
this.processSwipeEvent(aEvent, aDir);
|
||||
},
|
||||
_coordinateSwipeEventWithAnimation:
|
||||
function GS__coordinateSwipeEventWithAnimation(aEvent, aDir) {
|
||||
gHistorySwipeAnimation.stopAnimation();
|
||||
this.processSwipeEvent(aEvent, aDir);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get a gesture preference or use a default if it doesn't exist
|
||||
@ -612,8 +610,8 @@ var gGestureSupport = {
|
||||
}
|
||||
|
||||
let contentElement = window.content.document.body.firstElementChild;
|
||||
let transformValue = window.content.window.getComputedStyle(contentElement)
|
||||
.transform;
|
||||
let transformValue =
|
||||
window.content.window.getComputedStyle(contentElement).transform;
|
||||
|
||||
if (transformValue == "none") {
|
||||
this.rotation = 0;
|
||||
|
@ -7,9 +7,8 @@
|
||||
|
||||
var gPageStyleMenu = {
|
||||
_getStyleSheetInfo(browser) {
|
||||
let actor = browser.browsingContext.currentWindowGlobal?.getActor(
|
||||
"PageStyle"
|
||||
);
|
||||
let actor =
|
||||
browser.browsingContext.currentWindowGlobal?.getActor("PageStyle");
|
||||
let styleSheetInfo;
|
||||
if (actor) {
|
||||
styleSheetInfo = actor.getSheetInfo();
|
||||
|
@ -175,11 +175,8 @@ var StarUI = {
|
||||
* Handle popup hidden event.
|
||||
*/
|
||||
async _handlePopupHiddenEvent() {
|
||||
const {
|
||||
bookmarkState,
|
||||
didChangeFolder,
|
||||
selectedFolderGuid,
|
||||
} = gEditItemOverlay;
|
||||
const { bookmarkState, didChangeFolder, selectedFolderGuid } =
|
||||
gEditItemOverlay;
|
||||
gEditItemOverlay.uninitPanel(true);
|
||||
|
||||
// Capture _removeBookmarksOnPopupHidden and _itemGuids values. Reset them
|
||||
@ -225,9 +222,8 @@ var StarUI = {
|
||||
titleL10nID
|
||||
);
|
||||
|
||||
this._element(
|
||||
"editBookmarkPanel_showForNewBookmarks"
|
||||
).checked = this.showForNewBookmarks;
|
||||
this._element("editBookmarkPanel_showForNewBookmarks").checked =
|
||||
this.showForNewBookmarks;
|
||||
|
||||
this._itemGuids = [];
|
||||
await PlacesUtils.bookmarks.fetch({ url: aUrl }, bookmark =>
|
||||
@ -683,11 +679,12 @@ class HistoryMenu extends PlacesMenu {
|
||||
this.undoWindowMenu.removeAttribute("disabled");
|
||||
|
||||
// populate menu
|
||||
let windowsFragment = RecentlyClosedTabsAndWindowsMenuUtils.getWindowsFragment(
|
||||
window,
|
||||
"menuitem",
|
||||
/* aPrefixRestoreAll = */ false
|
||||
);
|
||||
let windowsFragment =
|
||||
RecentlyClosedTabsAndWindowsMenuUtils.getWindowsFragment(
|
||||
window,
|
||||
"menuitem",
|
||||
/* aPrefixRestoreAll = */ false
|
||||
);
|
||||
undoPopup.appendChild(windowsFragment);
|
||||
}
|
||||
|
||||
@ -729,7 +726,8 @@ class HistoryMenu extends PlacesMenu {
|
||||
}
|
||||
openUILink(placesNode.uri, aEvent, {
|
||||
ignoreAlt: true,
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
triggeringPrincipal:
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1534,9 +1532,8 @@ var BookmarkingUI = {
|
||||
return false;
|
||||
}
|
||||
// Hmm, apparently not. Check for bookmarks or customize mode:
|
||||
let bookmarksToolbarItemsPlacement = CustomizableUI.getPlacementOfWidget(
|
||||
"personal-bookmarks"
|
||||
);
|
||||
let bookmarksToolbarItemsPlacement =
|
||||
CustomizableUI.getPlacementOfWidget("personal-bookmarks");
|
||||
let bookmarksItemInToolbar =
|
||||
bookmarksToolbarItemsPlacement?.area == CustomizableUI.AREA_BOOKMARKS;
|
||||
if (!bookmarksItemInToolbar) {
|
||||
|
@ -194,9 +194,8 @@ var gIdentityHandler = {
|
||||
},
|
||||
get _identityIconBox() {
|
||||
delete this._identityIconBox;
|
||||
return (this._identityIconBox = document.getElementById(
|
||||
"identity-icon-box"
|
||||
));
|
||||
return (this._identityIconBox =
|
||||
document.getElementById("identity-icon-box"));
|
||||
},
|
||||
get _identityPopupMultiView() {
|
||||
delete this._identityPopupMultiView;
|
||||
@ -230,9 +229,8 @@ var gIdentityHandler = {
|
||||
},
|
||||
get _identityPopupHttpsOnlyModeMenuListTempItem() {
|
||||
delete this._identityPopupHttpsOnlyModeMenuListTempItem;
|
||||
return (this._identityPopupHttpsOnlyModeMenuListTempItem = document.getElementById(
|
||||
"identity-popup-security-menulist-tempitem"
|
||||
));
|
||||
return (this._identityPopupHttpsOnlyModeMenuListTempItem =
|
||||
document.getElementById("identity-popup-security-menulist-tempitem"));
|
||||
},
|
||||
get _identityPopupSecurityEVContentOwner() {
|
||||
delete this._identityPopupSecurityEVContentOwner;
|
||||
@ -552,7 +550,8 @@ var gIdentityHandler = {
|
||||
// from HTTPS to HTTP. Otherwise we can just reload the page.
|
||||
if (this._isAboutHttpsOnlyErrorPage) {
|
||||
gBrowser.loadURI(newURI, {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
triggeringPrincipal:
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
loadFlags: Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY,
|
||||
});
|
||||
if (this._popupInitialized) {
|
||||
@ -746,9 +745,10 @@ var gIdentityHandler = {
|
||||
*/
|
||||
_hasCustomRoot() {
|
||||
let issuerCert = null;
|
||||
issuerCert = this._secInfo.succeededCertChain[
|
||||
this._secInfo.succeededCertChain.length - 1
|
||||
];
|
||||
issuerCert =
|
||||
this._secInfo.succeededCertChain[
|
||||
this._secInfo.succeededCertChain.length - 1
|
||||
];
|
||||
|
||||
return !issuerCert.isBuiltInRoot;
|
||||
},
|
||||
@ -1101,10 +1101,8 @@ var gIdentityHandler = {
|
||||
}
|
||||
);
|
||||
|
||||
this._identityPopupSecurityEVContentOwner.textContent = gNavigatorBundle.getFormattedString(
|
||||
"identity.ev.contentOwner2",
|
||||
[owner]
|
||||
);
|
||||
this._identityPopupSecurityEVContentOwner.textContent =
|
||||
gNavigatorBundle.getFormattedString("identity.ev.contentOwner2", [owner]);
|
||||
|
||||
this._identityPopupContentOwner.textContent = owner;
|
||||
this._identityPopupContentSupp.textContent = supplemental;
|
||||
|
@ -64,9 +64,8 @@ var gPermissionPanel = {
|
||||
return null;
|
||||
}
|
||||
delete this._permissionPopup;
|
||||
return (this._permissionPopup = document.getElementById(
|
||||
"permission-popup"
|
||||
));
|
||||
return (this._permissionPopup =
|
||||
document.getElementById("permission-popup"));
|
||||
},
|
||||
get _permissionPopupMainView() {
|
||||
delete this._permissionPopupPopupMainView;
|
||||
@ -133,10 +132,8 @@ var gPermissionPanel = {
|
||||
let host = gIdentityHandler.getHostForDisplay();
|
||||
|
||||
// Update header label
|
||||
this._permissionPopupMainViewHeaderLabel.textContent = gNavigatorBundle.getFormattedString(
|
||||
"permissions.header",
|
||||
[host]
|
||||
);
|
||||
this._permissionPopupMainViewHeaderLabel.textContent =
|
||||
gNavigatorBundle.getFormattedString("permissions.header", [host]);
|
||||
|
||||
// Refresh the permission list
|
||||
this.updateSitePermissions();
|
||||
@ -473,7 +470,8 @@ var gPermissionPanel = {
|
||||
}
|
||||
}
|
||||
|
||||
let totalBlockedPopups = gBrowser.selectedBrowser.popupBlocker.getBlockedPopupCount();
|
||||
let totalBlockedPopups =
|
||||
gBrowser.selectedBrowser.popupBlocker.getBlockedPopupCount();
|
||||
let hasBlockedPopupIndicator = false;
|
||||
for (let permission of permissions) {
|
||||
let [id, key] = permission.id.split(SitePermissions.PERM_KEY_DELIMITER);
|
||||
@ -785,9 +783,10 @@ var gPermissionPanel = {
|
||||
if (permission.sharingState && idNoSuffix === "xr") {
|
||||
let origins = browser.getDevicePermissionOrigins(idNoSuffix);
|
||||
for (let origin of origins) {
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
origin
|
||||
);
|
||||
let principal =
|
||||
Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
origin
|
||||
);
|
||||
this._removePermPersistentAllow(principal, permission.id);
|
||||
}
|
||||
origins.clear();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -924,9 +924,8 @@ var gSync = {
|
||||
}
|
||||
mainWindowEl.setAttribute("fxastatus", stateValue);
|
||||
|
||||
menuHeaderTitleEl.value = this.fluentStrings.formatValueSync(
|
||||
headerTitleL10nId
|
||||
);
|
||||
menuHeaderTitleEl.value =
|
||||
this.fluentStrings.formatValueSync(headerTitleL10nId);
|
||||
menuHeaderDescriptionEl.value = headerDescription;
|
||||
// We remove the data-l10n-id attribute here to prevent the node's value
|
||||
// attribute from being overwritten by Fluent when the panel is moved
|
||||
@ -1028,13 +1027,11 @@ var gSync = {
|
||||
|
||||
// At this point we consider sync to be configured (but still can be in an error state).
|
||||
if (status == UIState.STATUS_LOGIN_FAILED) {
|
||||
const [
|
||||
tooltipDescription,
|
||||
errorLabel,
|
||||
] = this.fluentStrings.formatValuesSync([
|
||||
{ id: "account-reconnect", args: { email } },
|
||||
{ id: "account-disconnected2" },
|
||||
]);
|
||||
const [tooltipDescription, errorLabel] =
|
||||
this.fluentStrings.formatValuesSync([
|
||||
{ id: "account-reconnect", args: { email } },
|
||||
{ id: "account-disconnected2" },
|
||||
]);
|
||||
appMenuStatus.setAttribute("fxastatus", "login-failed");
|
||||
appMenuStatus.setAttribute("tooltiptext", tooltipDescription);
|
||||
appMenuLabel.classList.add("subviewbutton-nav");
|
||||
@ -1049,13 +1046,11 @@ var gSync = {
|
||||
);
|
||||
return;
|
||||
} else if (status == UIState.STATUS_NOT_VERIFIED) {
|
||||
const [
|
||||
tooltipDescription,
|
||||
unverifiedLabel,
|
||||
] = this.fluentStrings.formatValuesSync([
|
||||
{ id: "account-verify", args: { email } },
|
||||
{ id: "account-finish-account-setup" },
|
||||
]);
|
||||
const [tooltipDescription, unverifiedLabel] =
|
||||
this.fluentStrings.formatValuesSync([
|
||||
{ id: "account-verify", args: { email } },
|
||||
{ id: "account-finish-account-setup" },
|
||||
]);
|
||||
appMenuStatus.setAttribute("fxastatus", "unverified");
|
||||
appMenuStatus.setAttribute("tooltiptext", tooltipDescription);
|
||||
appMenuLabel.classList.add("subviewbutton-nav");
|
||||
@ -1441,17 +1436,15 @@ var gSync = {
|
||||
const separator = createDeviceNodeFn();
|
||||
separator.classList.add("sync-menuitem");
|
||||
fragment.appendChild(separator);
|
||||
const [
|
||||
allDevicesLabel,
|
||||
manageDevicesLabel,
|
||||
] = this.fluentStrings.formatValuesSync(
|
||||
isFxaMenu
|
||||
? ["account-send-to-all-devices", "account-manage-devices"]
|
||||
: [
|
||||
"account-send-to-all-devices-titlecase",
|
||||
"account-manage-devices-titlecase",
|
||||
]
|
||||
);
|
||||
const [allDevicesLabel, manageDevicesLabel] =
|
||||
this.fluentStrings.formatValuesSync(
|
||||
isFxaMenu
|
||||
? ["account-send-to-all-devices", "account-manage-devices"]
|
||||
: [
|
||||
"account-send-to-all-devices-titlecase",
|
||||
"account-manage-devices-titlecase",
|
||||
]
|
||||
);
|
||||
addTargetDevice("", allDevicesLabel, "");
|
||||
|
||||
// "Manage devices" menu item
|
||||
@ -1475,15 +1468,12 @@ var gSync = {
|
||||
},
|
||||
|
||||
_appendSendTabSingleDevice(fragment, createDeviceNodeFn) {
|
||||
const [
|
||||
noDevices,
|
||||
learnMore,
|
||||
connectDevice,
|
||||
] = this.fluentStrings.formatValuesSync([
|
||||
"account-send-tab-to-device-singledevice-status",
|
||||
"account-send-tab-to-device-singledevice-learnmore",
|
||||
"account-send-tab-to-device-connectdevice",
|
||||
]);
|
||||
const [noDevices, learnMore, connectDevice] =
|
||||
this.fluentStrings.formatValuesSync([
|
||||
"account-send-tab-to-device-singledevice-status",
|
||||
"account-send-tab-to-device-singledevice-learnmore",
|
||||
"account-send-tab-to-device-connectdevice",
|
||||
]);
|
||||
const actions = [
|
||||
{
|
||||
label: connectDevice,
|
||||
|
@ -213,9 +213,8 @@ ToolbarKeyboardNavigator = {
|
||||
// Then work out if any of the earlier ones are in a visible
|
||||
// toolbar:
|
||||
while (earlierVisibleStopIndex >= 0) {
|
||||
let stopToolbar = allStops[earlierVisibleStopIndex].closest(
|
||||
"toolbar"
|
||||
);
|
||||
let stopToolbar =
|
||||
allStops[earlierVisibleStopIndex].closest("toolbar");
|
||||
if (!stopToolbar.collapsed) {
|
||||
break;
|
||||
}
|
||||
|
@ -175,9 +175,8 @@ customElements.define(
|
||||
OriginControls.getAttention(this.extension.policy, this.ownerGlobal)
|
||||
);
|
||||
|
||||
this.querySelector(
|
||||
".unified-extensions-item-name"
|
||||
).textContent = this.extension.name;
|
||||
this.querySelector(".unified-extensions-item-name").textContent =
|
||||
this.extension.name;
|
||||
|
||||
AddonManager.getAddonByID(this.extension.id).then(addon => {
|
||||
const iconURL = AddonManager.getPreferredIconURL(addon, 32, window);
|
||||
|
@ -600,10 +600,12 @@ customElements.setElementCreationCallback("screenshots-buttons", () => {
|
||||
|
||||
var gBrowser;
|
||||
var gContextMenu = null; // nsContextMenu instance
|
||||
var gMultiProcessBrowser = window.docShell.QueryInterface(Ci.nsILoadContext)
|
||||
.useRemoteTabs;
|
||||
var gFissionBrowser = window.docShell.QueryInterface(Ci.nsILoadContext)
|
||||
.useRemoteSubframes;
|
||||
var gMultiProcessBrowser = window.docShell.QueryInterface(
|
||||
Ci.nsILoadContext
|
||||
).useRemoteTabs;
|
||||
var gFissionBrowser = window.docShell.QueryInterface(
|
||||
Ci.nsILoadContext
|
||||
).useRemoteSubframes;
|
||||
|
||||
var gBrowserAllowScriptsToCloseInitialTabs = false;
|
||||
|
||||
@ -1054,14 +1056,14 @@ var gPopupBlockerObserver = {
|
||||
|
||||
gPermissionPanel.refreshPermissionIcons();
|
||||
|
||||
let popupCount = gBrowser.selectedBrowser.popupBlocker.getBlockedPopupCount();
|
||||
let popupCount =
|
||||
gBrowser.selectedBrowser.popupBlocker.getBlockedPopupCount();
|
||||
|
||||
if (!popupCount) {
|
||||
// Hide the notification box (if it's visible).
|
||||
let notificationBox = gBrowser.getNotificationBox();
|
||||
let notification = notificationBox.getNotificationWithValue(
|
||||
"popup-blocked"
|
||||
);
|
||||
let notification =
|
||||
notificationBox.getNotificationWithValue("popup-blocked");
|
||||
if (notification) {
|
||||
notificationBox.removeNotification(notification, false);
|
||||
}
|
||||
@ -1082,9 +1084,8 @@ var gPopupBlockerObserver = {
|
||||
};
|
||||
|
||||
let notificationBox = gBrowser.getNotificationBox();
|
||||
let notification = notificationBox.getNotificationWithValue(
|
||||
"popup-blocked"
|
||||
);
|
||||
let notification =
|
||||
notificationBox.getNotificationWithValue("popup-blocked");
|
||||
if (notification) {
|
||||
notification.label = label;
|
||||
} else {
|
||||
@ -1966,9 +1967,8 @@ var gBrowserInit = {
|
||||
child => !("toplevel_name" in child)
|
||||
);
|
||||
if (children.length) {
|
||||
let managedBookmarksButton = document.createXULElement(
|
||||
"toolbarbutton"
|
||||
);
|
||||
let managedBookmarksButton =
|
||||
document.createXULElement("toolbarbutton");
|
||||
managedBookmarksButton.setAttribute("id", "managed-bookmarks");
|
||||
managedBookmarksButton.setAttribute("class", "bookmark-item");
|
||||
let toplevel = managedBookmarks.find(
|
||||
@ -2179,9 +2179,10 @@ var gBrowserInit = {
|
||||
),
|
||||
};
|
||||
if (extraOptions.hasKey("triggeringSponsoredURLVisitTimeMS")) {
|
||||
globalHistoryOptions.triggeringSponsoredURLVisitTimeMS = extraOptions.getPropertyAsUint64(
|
||||
"triggeringSponsoredURLVisitTimeMS"
|
||||
);
|
||||
globalHistoryOptions.triggeringSponsoredURLVisitTimeMS =
|
||||
extraOptions.getPropertyAsUint64(
|
||||
"triggeringSponsoredURLVisitTimeMS"
|
||||
);
|
||||
}
|
||||
}
|
||||
if (extraOptions.hasKey("triggeringRemoteType")) {
|
||||
@ -2190,9 +2191,8 @@ var gBrowserInit = {
|
||||
);
|
||||
}
|
||||
if (extraOptions.hasKey("forceAllowDataURI")) {
|
||||
forceAllowDataURI = extraOptions.getPropertyAsBool(
|
||||
"forceAllowDataURI"
|
||||
);
|
||||
forceAllowDataURI =
|
||||
extraOptions.getPropertyAsBool("forceAllowDataURI");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2758,7 +2758,8 @@ function BrowserHome(aEvent) {
|
||||
notifyObservers = !loadInBackground;
|
||||
gBrowser.loadTabs(urls, {
|
||||
inBackground: loadInBackground,
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
triggeringPrincipal:
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
csp: null,
|
||||
});
|
||||
if (!loadInBackground) {
|
||||
@ -4598,10 +4599,11 @@ function updateEditUIVisibility() {
|
||||
}
|
||||
|
||||
let editMenuPopupState = document.getElementById("menu_EditPopup").state;
|
||||
let contextMenuPopupState = document.getElementById("contentAreaContextMenu")
|
||||
.state;
|
||||
let placesContextMenuPopupState = document.getElementById("placesContext")
|
||||
.state;
|
||||
let contextMenuPopupState = document.getElementById(
|
||||
"contentAreaContextMenu"
|
||||
).state;
|
||||
let placesContextMenuPopupState =
|
||||
document.getElementById("placesContext").state;
|
||||
|
||||
let oldVisible = gEditUIVisible;
|
||||
|
||||
@ -4910,8 +4912,9 @@ let gShareUtils = {
|
||||
return;
|
||||
}
|
||||
// Otherwise, clear its "data-initialized" attribute.
|
||||
let menupopup = event.target.querySelector(".share-tab-url-item")
|
||||
?.menupopup;
|
||||
let menupopup = event.target.querySelector(
|
||||
".share-tab-url-item"
|
||||
)?.menupopup;
|
||||
menupopup?.removeAttribute("data-initialized");
|
||||
|
||||
event.target.removeEventListener("popuphiding", this);
|
||||
@ -5286,7 +5289,8 @@ var XULBrowserWindow = {
|
||||
closeOpenPanels("panel[locationspecific='true']");
|
||||
}
|
||||
|
||||
let screenshotsButtonsDisabled = gScreenshots.shouldScreenshotsButtonBeDisabled();
|
||||
let screenshotsButtonsDisabled =
|
||||
gScreenshots.shouldScreenshotsButtonBeDisabled();
|
||||
Services.obs.notifyObservers(
|
||||
window,
|
||||
"toggle-screenshot-disable",
|
||||
@ -6209,9 +6213,8 @@ nsBrowserAccess.prototype = {
|
||||
break;
|
||||
}
|
||||
case Ci.nsIBrowserDOMWindow.OPEN_PRINT_BROWSER: {
|
||||
let browser = PrintUtils.handleStaticCloneCreatedForPrint(
|
||||
aOpenWindowInfo
|
||||
);
|
||||
let browser =
|
||||
PrintUtils.handleStaticCloneCreatedForPrint(aOpenWindowInfo);
|
||||
if (browser) {
|
||||
browsingContext = browser.browsingContext;
|
||||
}
|
||||
@ -6286,48 +6289,49 @@ nsBrowserAccess.prototype = {
|
||||
);
|
||||
},
|
||||
|
||||
getContentWindowOrOpenURIInFrame: function browser_getContentWindowOrOpenURIInFrame(
|
||||
aURI,
|
||||
aParams,
|
||||
aWhere,
|
||||
aFlags,
|
||||
aName,
|
||||
aSkipLoad
|
||||
) {
|
||||
if (aWhere == Ci.nsIBrowserDOMWindow.OPEN_PRINT_BROWSER) {
|
||||
return PrintUtils.handleStaticCloneCreatedForPrint(
|
||||
aParams.openWindowInfo
|
||||
);
|
||||
}
|
||||
|
||||
if (aWhere != Ci.nsIBrowserDOMWindow.OPEN_NEWTAB) {
|
||||
dump("Error: openURIInFrame can only open in new tabs or print");
|
||||
return null;
|
||||
}
|
||||
|
||||
var isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
|
||||
|
||||
var userContextId =
|
||||
aParams.openerOriginAttributes &&
|
||||
"userContextId" in aParams.openerOriginAttributes
|
||||
? aParams.openerOriginAttributes.userContextId
|
||||
: Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID;
|
||||
|
||||
return this._openURIInNewTab(
|
||||
getContentWindowOrOpenURIInFrame:
|
||||
function browser_getContentWindowOrOpenURIInFrame(
|
||||
aURI,
|
||||
aParams.referrerInfo,
|
||||
aParams.isPrivate,
|
||||
isExternal,
|
||||
false,
|
||||
userContextId,
|
||||
aParams.openWindowInfo,
|
||||
aParams.openerBrowser,
|
||||
aParams.triggeringPrincipal,
|
||||
aParams,
|
||||
aWhere,
|
||||
aFlags,
|
||||
aName,
|
||||
aParams.csp,
|
||||
aSkipLoad
|
||||
);
|
||||
},
|
||||
) {
|
||||
if (aWhere == Ci.nsIBrowserDOMWindow.OPEN_PRINT_BROWSER) {
|
||||
return PrintUtils.handleStaticCloneCreatedForPrint(
|
||||
aParams.openWindowInfo
|
||||
);
|
||||
}
|
||||
|
||||
if (aWhere != Ci.nsIBrowserDOMWindow.OPEN_NEWTAB) {
|
||||
dump("Error: openURIInFrame can only open in new tabs or print");
|
||||
return null;
|
||||
}
|
||||
|
||||
var isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
|
||||
|
||||
var userContextId =
|
||||
aParams.openerOriginAttributes &&
|
||||
"userContextId" in aParams.openerOriginAttributes
|
||||
? aParams.openerOriginAttributes.userContextId
|
||||
: Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID;
|
||||
|
||||
return this._openURIInNewTab(
|
||||
aURI,
|
||||
aParams.referrerInfo,
|
||||
aParams.isPrivate,
|
||||
isExternal,
|
||||
false,
|
||||
userContextId,
|
||||
aParams.openWindowInfo,
|
||||
aParams.openerBrowser,
|
||||
aParams.triggeringPrincipal,
|
||||
aName,
|
||||
aParams.csp,
|
||||
aSkipLoad
|
||||
);
|
||||
},
|
||||
|
||||
canClose() {
|
||||
return CanCloseWindow();
|
||||
@ -6456,9 +6460,8 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
||||
let menuSeparator = document.getElementById("toolbarItemsMenuSeparator");
|
||||
menuSeparator.hidden = false;
|
||||
|
||||
document.getElementById(
|
||||
"toolbarNavigatorItemsMenuSeparator"
|
||||
).hidden = !showTabStripItems;
|
||||
document.getElementById("toolbarNavigatorItemsMenuSeparator").hidden =
|
||||
!showTabStripItems;
|
||||
|
||||
if (
|
||||
!CustomizationHandler.isCustomizing() &&
|
||||
@ -6471,21 +6474,16 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
||||
|
||||
if (showTabStripItems) {
|
||||
let multipleTabsSelected = !!gBrowser.multiSelectedTabsCount;
|
||||
document.getElementById(
|
||||
"toolbar-context-bookmarkSelectedTabs"
|
||||
).hidden = !multipleTabsSelected;
|
||||
document.getElementById(
|
||||
"toolbar-context-bookmarkSelectedTab"
|
||||
).hidden = multipleTabsSelected;
|
||||
document.getElementById(
|
||||
"toolbar-context-reloadSelectedTabs"
|
||||
).hidden = !multipleTabsSelected;
|
||||
document.getElementById(
|
||||
"toolbar-context-reloadSelectedTab"
|
||||
).hidden = multipleTabsSelected;
|
||||
document.getElementById(
|
||||
"toolbar-context-selectAllTabs"
|
||||
).disabled = gBrowser.allTabsSelected();
|
||||
document.getElementById("toolbar-context-bookmarkSelectedTabs").hidden =
|
||||
!multipleTabsSelected;
|
||||
document.getElementById("toolbar-context-bookmarkSelectedTab").hidden =
|
||||
multipleTabsSelected;
|
||||
document.getElementById("toolbar-context-reloadSelectedTabs").hidden =
|
||||
!multipleTabsSelected;
|
||||
document.getElementById("toolbar-context-reloadSelectedTab").hidden =
|
||||
multipleTabsSelected;
|
||||
document.getElementById("toolbar-context-selectAllTabs").disabled =
|
||||
gBrowser.allTabsSelected();
|
||||
document.getElementById("toolbar-context-undoCloseTab").disabled =
|
||||
SessionStore.getClosedTabCount(window) == 0;
|
||||
return;
|
||||
@ -7437,9 +7435,8 @@ var CanvasPermissionPromptHelper = {
|
||||
1
|
||||
);
|
||||
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
aData
|
||||
);
|
||||
let principal =
|
||||
Services.scriptSecurityManager.createContentPrincipalFromOrigin(aData);
|
||||
|
||||
function setCanvasPermission(aPerm, aPersistent) {
|
||||
Services.perms.addFromPrincipal(
|
||||
|
@ -274,9 +274,10 @@ class nsContextMenu {
|
||||
|
||||
this.browser = this.ownerDoc.defaultView.docShell.chromeEventHandler;
|
||||
this.selectionInfo = SelectionUtils.getSelectionDetails(window);
|
||||
this.actor = this.browser.browsingContext.currentWindowGlobal.getActor(
|
||||
"ContextMenu"
|
||||
);
|
||||
this.actor =
|
||||
this.browser.browsingContext.currentWindowGlobal.getActor(
|
||||
"ContextMenu"
|
||||
);
|
||||
}
|
||||
|
||||
this.remoteType = this.actor?.domProcess?.remoteType;
|
||||
@ -710,9 +711,8 @@ class nsContextMenu {
|
||||
);
|
||||
|
||||
if (haveSetDesktopBackground && this.onLoadedImage) {
|
||||
document.getElementById(
|
||||
"context-setDesktopBackground"
|
||||
).disabled = this.contentData.disableSetDesktopBackground;
|
||||
document.getElementById("context-setDesktopBackground").disabled =
|
||||
this.contentData.disableSetDesktopBackground;
|
||||
}
|
||||
}
|
||||
|
||||
@ -802,8 +802,8 @@ class nsContextMenu {
|
||||
if (this.inFrame) {
|
||||
// To make it easier to debug the browser running with out-of-process iframes, we
|
||||
// display the process PID of the iframe in the context menu for the subframe.
|
||||
let frameOsPid = this.actor.manager.browsingContext.currentWindowGlobal
|
||||
.osPid;
|
||||
let frameOsPid =
|
||||
this.actor.manager.browsingContext.currentWindowGlobal.osPid;
|
||||
this.setItemAttr("context-frameOsPid", "label", "PID: " + frameOsPid);
|
||||
|
||||
// We need to check if "Take Screenshot" should be displayed in the "This Frame"
|
||||
@ -1563,7 +1563,8 @@ class nsContextMenu {
|
||||
relatedToCurrent,
|
||||
inBackground: inNewWindow,
|
||||
skipAnimation: inNewWindow,
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
triggeringPrincipal:
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});
|
||||
const viewSourceBrowser = tabBrowser.getBrowserForTab(tab);
|
||||
if (inNewWindow) {
|
||||
@ -2176,8 +2177,8 @@ class nsContextMenu {
|
||||
*/
|
||||
copyStrippedLink() {
|
||||
let strippedLinkURI = this.getStrippedLink();
|
||||
let strippedLinkURL = Services.io.createExposableURI(strippedLinkURI)
|
||||
?.displaySpec;
|
||||
let strippedLinkURL =
|
||||
Services.io.createExposableURI(strippedLinkURI)?.displaySpec;
|
||||
if (strippedLinkURL) {
|
||||
let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(
|
||||
Ci.nsIClipboardHelper
|
||||
|
@ -22,7 +22,8 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||
openerColorSchemeOverride &&
|
||||
window.browsingContext == window.browsingContext.top
|
||||
) {
|
||||
window.browsingContext.prefersColorSchemeOverride = openerColorSchemeOverride;
|
||||
window.browsingContext.prefersColorSchemeOverride =
|
||||
openerColorSchemeOverride;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -280,9 +280,10 @@
|
||||
let visibleTabs = this._getVisibleTabs();
|
||||
let lastTab = visibleTabs[visibleTabs.length - 1];
|
||||
let winUtils = window.windowUtils;
|
||||
let endOfTab = winUtils.getBoundsWithoutFlushing(lastTab)[
|
||||
RTL_UI ? "left" : "right"
|
||||
];
|
||||
let endOfTab =
|
||||
winUtils.getBoundsWithoutFlushing(lastTab)[
|
||||
RTL_UI ? "left" : "right"
|
||||
];
|
||||
if (
|
||||
(!RTL_UI && event.clientX > endOfTab) ||
|
||||
(RTL_UI && event.clientX < endOfTab)
|
||||
@ -818,9 +819,8 @@
|
||||
let newIndex = this._getDropIndex(event);
|
||||
let urls = links.map(link => link.url);
|
||||
let csp = browserDragAndDrop.getCsp(event);
|
||||
let triggeringPrincipal = browserDragAndDrop.getTriggeringPrincipal(
|
||||
event
|
||||
);
|
||||
let triggeringPrincipal =
|
||||
browserDragAndDrop.getTriggeringPrincipal(event);
|
||||
|
||||
(async () => {
|
||||
if (
|
||||
@ -1847,7 +1847,8 @@
|
||||
if (!this._backgroundTabScrollPromise) {
|
||||
this._backgroundTabScrollPromise = window
|
||||
.promiseDocumentFlushed(() => {
|
||||
let lastTabRect = this._lastTabToScrollIntoView.getBoundingClientRect();
|
||||
let lastTabRect =
|
||||
this._lastTabToScrollIntoView.getBoundingClientRect();
|
||||
let selectedTab = this.selectedItem;
|
||||
if (selectedTab.pinned) {
|
||||
selectedTab = null;
|
||||
|
@ -56,9 +56,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
let identity = ContextualIdentityService.getPublicIdentityFromId(
|
||||
userContextId
|
||||
);
|
||||
let identity =
|
||||
ContextualIdentityService.getPublicIdentityFromId(userContextId);
|
||||
if (!identity) {
|
||||
replaceContainerClass("color", hbox, "");
|
||||
hbox.hidden = true;
|
||||
@ -498,10 +497,11 @@
|
||||
URILoadingWrapper,
|
||||
browser
|
||||
);
|
||||
browser.fixupAndLoadURIString = URILoadingWrapper.fixupAndLoadURIString.bind(
|
||||
URILoadingWrapper,
|
||||
browser
|
||||
);
|
||||
browser.fixupAndLoadURIString =
|
||||
URILoadingWrapper.fixupAndLoadURIString.bind(
|
||||
URILoadingWrapper,
|
||||
browser
|
||||
);
|
||||
|
||||
let uniqueId = this._generateUniquePanelID();
|
||||
let panel = this.getPanel(browser);
|
||||
@ -1200,8 +1200,10 @@
|
||||
|
||||
this._updateVisibleNotificationBox(newBrowser);
|
||||
|
||||
let oldBrowserPopupsBlocked = oldBrowser.popupBlocker.getBlockedPopupCount();
|
||||
let newBrowserPopupsBlocked = newBrowser.popupBlocker.getBlockedPopupCount();
|
||||
let oldBrowserPopupsBlocked =
|
||||
oldBrowser.popupBlocker.getBlockedPopupCount();
|
||||
let newBrowserPopupsBlocked =
|
||||
newBrowser.popupBlocker.getBlockedPopupCount();
|
||||
if (oldBrowserPopupsBlocked != newBrowserPopupsBlocked) {
|
||||
newBrowser.popupBlocker.updateBlockedPopupsUI();
|
||||
}
|
||||
@ -1682,8 +1684,9 @@
|
||||
// See if we can use the URI as the title.
|
||||
if (browser.currentURI.displaySpec) {
|
||||
try {
|
||||
title = Services.io.createExposableURI(browser.currentURI)
|
||||
.displaySpec;
|
||||
title = Services.io.createExposableURI(
|
||||
browser.currentURI
|
||||
).displaySpec;
|
||||
} catch (ex) {
|
||||
title = browser.currentURI.displaySpec;
|
||||
}
|
||||
@ -2381,10 +2384,11 @@
|
||||
URILoadingWrapper,
|
||||
browser
|
||||
);
|
||||
browser.fixupAndLoadURIString = URILoadingWrapper.fixupAndLoadURIString.bind(
|
||||
URILoadingWrapper,
|
||||
browser
|
||||
);
|
||||
browser.fixupAndLoadURIString =
|
||||
URILoadingWrapper.fixupAndLoadURIString.bind(
|
||||
URILoadingWrapper,
|
||||
browser
|
||||
);
|
||||
|
||||
// Most of the time, we start our browser's docShells out as inactive,
|
||||
// and then maintain activeness in the tab switcher. Preloaded about:newtab's
|
||||
@ -2528,11 +2532,10 @@
|
||||
*/
|
||||
addWebTab(aURI, params = {}) {
|
||||
if (!params.triggeringPrincipal) {
|
||||
params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal(
|
||||
{
|
||||
params.triggeringPrincipal =
|
||||
Services.scriptSecurityManager.createNullPrincipal({
|
||||
userContextId: params.userContextId,
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
if (params.triggeringPrincipal.isSystemPrincipal) {
|
||||
throw new Error(
|
||||
@ -2562,7 +2565,8 @@
|
||||
* If in doubt use addWebTab
|
||||
*/
|
||||
addTrustedTab(aURI, params = {}) {
|
||||
params.triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
params.triggeringPrincipal =
|
||||
Services.scriptSecurityManager.getSystemPrincipal();
|
||||
return this.addTab(aURI, params);
|
||||
},
|
||||
|
||||
@ -2743,9 +2747,8 @@
|
||||
{
|
||||
url: lazyBrowserURI?.spec || "about:blank",
|
||||
title: lazyTabTitle,
|
||||
triggeringPrincipal_base64: E10SUtils.serializePrincipal(
|
||||
triggeringPrincipal
|
||||
),
|
||||
triggeringPrincipal_base64:
|
||||
E10SUtils.serializePrincipal(triggeringPrincipal),
|
||||
},
|
||||
],
|
||||
// Make sure to store the userContextId associated to the lazy tab
|
||||
@ -3761,15 +3764,13 @@
|
||||
*/
|
||||
async runBeforeUnloadForTabs(tabs) {
|
||||
try {
|
||||
let {
|
||||
beforeUnloadComplete,
|
||||
tabsWithBeforeUnloadPrompt,
|
||||
} = this._startRemoveTabs(tabs, {
|
||||
animate: false,
|
||||
suppressWarnAboutClosingWindow: false,
|
||||
skipPermitUnload: false,
|
||||
skipRemoves: true,
|
||||
});
|
||||
let { beforeUnloadComplete, tabsWithBeforeUnloadPrompt } =
|
||||
this._startRemoveTabs(tabs, {
|
||||
animate: false,
|
||||
suppressWarnAboutClosingWindow: false,
|
||||
skipPermitUnload: false,
|
||||
skipRemoves: true,
|
||||
});
|
||||
|
||||
await beforeUnloadComplete;
|
||||
|
||||
@ -3829,16 +3830,13 @@
|
||||
|
||||
// Guarantee that _clearMultiSelectionLocked lock gets released.
|
||||
try {
|
||||
let {
|
||||
beforeUnloadComplete,
|
||||
tabsWithBeforeUnloadPrompt,
|
||||
lastToClose,
|
||||
} = this._startRemoveTabs(tabs, {
|
||||
animate,
|
||||
suppressWarnAboutClosingWindow,
|
||||
skipPermitUnload,
|
||||
skipRemoves: false,
|
||||
});
|
||||
let { beforeUnloadComplete, tabsWithBeforeUnloadPrompt, lastToClose } =
|
||||
this._startRemoveTabs(tabs, {
|
||||
animate,
|
||||
suppressWarnAboutClosingWindow,
|
||||
skipPermitUnload,
|
||||
skipRemoves: false,
|
||||
});
|
||||
|
||||
// Wait for all the beforeunload events to have been processed by content processes.
|
||||
// The permitUnload() promise will, alas, not call its resolution
|
||||
@ -4699,9 +4697,8 @@
|
||||
// If switcher is active, it will intercept swap events and
|
||||
// react as needed.
|
||||
if (!this._switcher) {
|
||||
aOtherBrowser.docShellIsActive = this.shouldActivateDocShell(
|
||||
ourBrowser
|
||||
);
|
||||
aOtherBrowser.docShellIsActive =
|
||||
this.shouldActivateDocShell(ourBrowser);
|
||||
}
|
||||
|
||||
// Swap the docshells
|
||||
@ -5600,15 +5597,12 @@
|
||||
|
||||
try {
|
||||
this._awaitingToggleCaretBrowsingPrompt = true;
|
||||
const [
|
||||
title,
|
||||
message,
|
||||
checkbox,
|
||||
] = this.tabLocalization.formatValuesSync([
|
||||
"tabbrowser-confirm-caretbrowsing-title",
|
||||
"tabbrowser-confirm-caretbrowsing-message",
|
||||
"tabbrowser-confirm-caretbrowsing-checkbox",
|
||||
]);
|
||||
const [title, message, checkbox] =
|
||||
this.tabLocalization.formatValuesSync([
|
||||
"tabbrowser-confirm-caretbrowsing-title",
|
||||
"tabbrowser-confirm-caretbrowsing-message",
|
||||
"tabbrowser-confirm-caretbrowsing-checkbox",
|
||||
]);
|
||||
var buttonPressed = promptService.confirmEx(
|
||||
window,
|
||||
title,
|
||||
@ -5840,9 +5834,8 @@
|
||||
// true if we're refreshing the page. false if we're redirecting.
|
||||
|
||||
let notificationBox = this.getNotificationBox(browser);
|
||||
let notification = notificationBox.getNotificationWithValue(
|
||||
"refresh-blocked"
|
||||
);
|
||||
let notification =
|
||||
notificationBox.getNotificationWithValue("refresh-blocked");
|
||||
|
||||
let l10nId = data.sameURI
|
||||
? "refresh-blocked-refresh-label"
|
||||
@ -6606,11 +6599,8 @@
|
||||
location
|
||||
);
|
||||
|
||||
const {
|
||||
STATE_START,
|
||||
STATE_STOP,
|
||||
STATE_IS_NETWORK,
|
||||
} = Ci.nsIWebProgressListener;
|
||||
const { STATE_START, STATE_STOP, STATE_IS_NETWORK } =
|
||||
Ci.nsIWebProgressListener;
|
||||
|
||||
// If we were ignoring some messages about the initial about:blank, and we
|
||||
// got the STATE_STOP for it, we'll want to pay attention to those messages
|
||||
@ -6672,7 +6662,8 @@
|
||||
isURL: true,
|
||||
});
|
||||
|
||||
this.mBrowser.browsingContext.nonWebControlledBlankURI = originalLocation;
|
||||
this.mBrowser.browsingContext.nonWebControlledBlankURI =
|
||||
originalLocation;
|
||||
if (this.mTab.selected && !gBrowser.userTypedValue) {
|
||||
gURLBar.setURI();
|
||||
}
|
||||
@ -7123,7 +7114,8 @@
|
||||
.getService(Ci.nsIMIMEService)
|
||||
.getTypeFromURI(aUri);
|
||||
if (mimeType == "application/x-xpinstall") {
|
||||
let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
let systemPrincipal =
|
||||
Services.scriptSecurityManager.getSystemPrincipal();
|
||||
AddonManager.getInstallForURL(aUri.spec, {
|
||||
telemetryInfo: { source: "file-url" },
|
||||
}).then(install => {
|
||||
@ -7481,9 +7473,8 @@ var TabContextMenu = {
|
||||
|
||||
// Only one of Reload_Tab/Reload_Selected_Tabs should be visible.
|
||||
document.getElementById("context_reloadTab").hidden = multiselectionContext;
|
||||
document.getElementById(
|
||||
"context_reloadSelectedTabs"
|
||||
).hidden = !multiselectionContext;
|
||||
document.getElementById("context_reloadSelectedTabs").hidden =
|
||||
!multiselectionContext;
|
||||
|
||||
// Show Play Tab menu item if the tab has attribute activemedia-blocked
|
||||
document.getElementById("context_playTab").hidden = !(
|
||||
@ -7550,12 +7541,10 @@ var TabContextMenu = {
|
||||
}
|
||||
|
||||
// Only one of "Duplicate Tab"/"Duplicate Tabs" should be visible.
|
||||
document.getElementById(
|
||||
"context_duplicateTab"
|
||||
).hidden = multiselectionContext;
|
||||
document.getElementById(
|
||||
"context_duplicateTabs"
|
||||
).hidden = !multiselectionContext;
|
||||
document.getElementById("context_duplicateTab").hidden =
|
||||
multiselectionContext;
|
||||
document.getElementById("context_duplicateTabs").hidden =
|
||||
!multiselectionContext;
|
||||
|
||||
// Disable "Close Tabs to the Left/Right" if there are no tabs
|
||||
// preceding/following it.
|
||||
@ -7712,9 +7701,8 @@ var TabContextMenu = {
|
||||
// Ensure that we have a null principal if we couldn't
|
||||
// deserialize it (for lazy tab browsers) ...
|
||||
// This won't always work however is safe to use.
|
||||
triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal(
|
||||
{ userContextId }
|
||||
);
|
||||
triggeringPrincipal =
|
||||
Services.scriptSecurityManager.createNullPrincipal({ userContextId });
|
||||
} else if (triggeringPrincipal.isContentPrincipal) {
|
||||
triggeringPrincipal = Services.scriptSecurityManager.principalWithOA(
|
||||
triggeringPrincipal,
|
||||
|
@ -212,9 +212,10 @@ add_task(async function checkAdvancedDetails() {
|
||||
content.getComputedStyle(div).display !== "none",
|
||||
"Debug information is visible"
|
||||
);
|
||||
let failedCertChain = content.docShell.failedChannel.securityInfo.failedCertChain.map(
|
||||
cert => cert.getBase64DERString()
|
||||
);
|
||||
let failedCertChain =
|
||||
content.docShell.failedChannel.securityInfo.failedCertChain.map(cert =>
|
||||
cert.getBase64DERString()
|
||||
);
|
||||
return {
|
||||
divDisplay: content.getComputedStyle(div).display,
|
||||
text: text.textContent,
|
||||
@ -293,9 +294,10 @@ add_task(async function checkAdvancedDetailsForHSTS() {
|
||||
errorCode.click();
|
||||
let div = doc.getElementById("certificateErrorDebugInformation");
|
||||
let text = doc.getElementById("certificateErrorText");
|
||||
let failedCertChain = content.docShell.failedChannel.securityInfo.failedCertChain.map(
|
||||
cert => cert.getBase64DERString()
|
||||
);
|
||||
let failedCertChain =
|
||||
content.docShell.failedChannel.securityInfo.failedCertChain.map(cert =>
|
||||
cert.getBase64DERString()
|
||||
);
|
||||
return {
|
||||
divDisplay: content.getComputedStyle(div).display,
|
||||
text: text.textContent,
|
||||
@ -385,9 +387,8 @@ add_task(async function checkViewCertificate() {
|
||||
return doc.querySelector("certificate-section");
|
||||
}, "Certificate section found");
|
||||
|
||||
let infoGroup = certificateSection.shadowRoot.querySelector(
|
||||
"info-group"
|
||||
);
|
||||
let infoGroup =
|
||||
certificateSection.shadowRoot.querySelector("info-group");
|
||||
Assert.ok(infoGroup, "infoGroup found");
|
||||
|
||||
let items = infoGroup.shadowRoot.querySelectorAll("info-item");
|
||||
@ -400,9 +401,8 @@ add_task(async function checkViewCertificate() {
|
||||
"The correct item was selected"
|
||||
);
|
||||
|
||||
let commonnameValue = items[items.length - 1].shadowRoot.querySelector(
|
||||
".info"
|
||||
).textContent;
|
||||
let commonnameValue =
|
||||
items[items.length - 1].shadowRoot.querySelector(".info").textContent;
|
||||
Assert.equal(
|
||||
commonnameValue,
|
||||
"self-signed.example.com",
|
||||
|
@ -113,18 +113,20 @@ add_task(async function checkBadStsCert() {
|
||||
let tab = await openErrorPage(BAD_STS_CERT, useFrame);
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
await SpecialPowers.spawn(browser, [{ frame: useFrame }], async function ({
|
||||
frame,
|
||||
}) {
|
||||
let doc = frame
|
||||
? content.document.querySelector("iframe").contentDocument
|
||||
: content.document;
|
||||
let exceptionButton = doc.getElementById("exceptionDialogButton");
|
||||
ok(
|
||||
ContentTaskUtils.is_hidden(exceptionButton),
|
||||
"Exception button is hidden."
|
||||
);
|
||||
});
|
||||
await SpecialPowers.spawn(
|
||||
browser,
|
||||
[{ frame: useFrame }],
|
||||
async function ({ frame }) {
|
||||
let doc = frame
|
||||
? content.document.querySelector("iframe").contentDocument
|
||||
: content.document;
|
||||
let exceptionButton = doc.getElementById("exceptionDialogButton");
|
||||
ok(
|
||||
ContentTaskUtils.is_hidden(exceptionButton),
|
||||
"Exception button is hidden."
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
let message = await SpecialPowers.spawn(
|
||||
browser,
|
||||
@ -179,19 +181,21 @@ add_task(async function checkhideAddExceptionButtonViaPref() {
|
||||
let tab = await openErrorPage(BAD_CERT, useFrame);
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
await SpecialPowers.spawn(browser, [{ frame: useFrame }], async function ({
|
||||
frame,
|
||||
}) {
|
||||
let doc = frame
|
||||
? content.document.querySelector("iframe").contentDocument
|
||||
: content.document;
|
||||
await SpecialPowers.spawn(
|
||||
browser,
|
||||
[{ frame: useFrame }],
|
||||
async function ({ frame }) {
|
||||
let doc = frame
|
||||
? content.document.querySelector("iframe").contentDocument
|
||||
: content.document;
|
||||
|
||||
let exceptionButton = doc.getElementById("exceptionDialogButton");
|
||||
ok(
|
||||
ContentTaskUtils.is_hidden(exceptionButton),
|
||||
"Exception button is hidden."
|
||||
);
|
||||
});
|
||||
let exceptionButton = doc.getElementById("exceptionDialogButton");
|
||||
ok(
|
||||
ContentTaskUtils.is_hidden(exceptionButton),
|
||||
"Exception button is hidden."
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
}
|
||||
|
@ -71,15 +71,17 @@ add_task(async function () {
|
||||
);
|
||||
|
||||
// Perform a search to increase the SEARCH_COUNT histogram.
|
||||
await SpecialPowers.spawn(browser, [{ searchStr }], async function (
|
||||
args
|
||||
) {
|
||||
let doc = content.document;
|
||||
info("Perform a search.");
|
||||
let el = doc.querySelector(["#searchText", "#newtab-search-text"]);
|
||||
el.value = args.searchStr;
|
||||
doc.getElementById("searchSubmit").click();
|
||||
});
|
||||
await SpecialPowers.spawn(
|
||||
browser,
|
||||
[{ searchStr }],
|
||||
async function (args) {
|
||||
let doc = content.document;
|
||||
info("Perform a search.");
|
||||
let el = doc.querySelector(["#searchText", "#newtab-search-text"]);
|
||||
el.value = args.searchStr;
|
||||
doc.getElementById("searchSubmit").click();
|
||||
}
|
||||
);
|
||||
|
||||
await promise;
|
||||
|
||||
|
@ -16,18 +16,24 @@ add_task(async function test_csp() {
|
||||
let cspBrowser = gBrowser.selectedTab.linkedBrowser;
|
||||
|
||||
// The blocked page opened in a new window/tab
|
||||
await SpecialPowers.spawn(cspBrowser, [BLOCKED_PAGE], async function (
|
||||
cspBlockedPage
|
||||
) {
|
||||
let cookieHeader = content.document.getElementById("strictCookie");
|
||||
let location = content.document.location.href;
|
||||
await SpecialPowers.spawn(
|
||||
cspBrowser,
|
||||
[BLOCKED_PAGE],
|
||||
async function (cspBlockedPage) {
|
||||
let cookieHeader = content.document.getElementById("strictCookie");
|
||||
let location = content.document.location.href;
|
||||
|
||||
Assert.ok(
|
||||
cookieHeader.textContent.includes("No same site strict cookie header"),
|
||||
"Same site strict cookie has not been set"
|
||||
);
|
||||
Assert.equal(location, cspBlockedPage, "Location of new page is correct!");
|
||||
});
|
||||
Assert.ok(
|
||||
cookieHeader.textContent.includes("No same site strict cookie header"),
|
||||
"Same site strict cookie has not been set"
|
||||
);
|
||||
Assert.equal(
|
||||
location,
|
||||
cspBlockedPage,
|
||||
"Location of new page is correct!"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
Services.cookies.removeAll();
|
||||
BrowserTestUtils.removeTab(iframePageTab);
|
||||
|
@ -16,18 +16,24 @@ add_task(async function test_xfo_iframe() {
|
||||
let xfoBrowser = gBrowser.selectedTab.linkedBrowser;
|
||||
|
||||
// The blocked page opened in a new window/tab
|
||||
await SpecialPowers.spawn(xfoBrowser, [BLOCKED_PAGE], async function (
|
||||
xfoBlockedPage
|
||||
) {
|
||||
let cookieHeader = content.document.getElementById("strictCookie");
|
||||
let location = content.document.location.href;
|
||||
await SpecialPowers.spawn(
|
||||
xfoBrowser,
|
||||
[BLOCKED_PAGE],
|
||||
async function (xfoBlockedPage) {
|
||||
let cookieHeader = content.document.getElementById("strictCookie");
|
||||
let location = content.document.location.href;
|
||||
|
||||
Assert.ok(
|
||||
cookieHeader.textContent.includes("No same site strict cookie header"),
|
||||
"Same site strict cookie has not been set"
|
||||
);
|
||||
Assert.equal(location, xfoBlockedPage, "Location of new page is correct!");
|
||||
});
|
||||
Assert.ok(
|
||||
cookieHeader.textContent.includes("No same site strict cookie header"),
|
||||
"Same site strict cookie has not been set"
|
||||
);
|
||||
Assert.equal(
|
||||
location,
|
||||
xfoBlockedPage,
|
||||
"Location of new page is correct!"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
Services.cookies.removeAll();
|
||||
BrowserTestUtils.removeTab(iframePageTab);
|
||||
|
@ -7,39 +7,36 @@ add_task(async function test_places_db_stats_table() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: "about:support" },
|
||||
async function (browser) {
|
||||
const [
|
||||
initialToggleText,
|
||||
toggleTextAfterShow,
|
||||
toggleTextAfterHide,
|
||||
] = await SpecialPowers.spawn(browser, [], async function () {
|
||||
const toggleButton = content.document.getElementById(
|
||||
"place-database-stats-toggle"
|
||||
);
|
||||
const getToggleText = () =>
|
||||
content.document.l10n.getAttributes(toggleButton).id;
|
||||
const toggleTexts = [];
|
||||
const table = content.document.getElementById(
|
||||
"place-database-stats-tbody"
|
||||
);
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => table.style.display === "none",
|
||||
"Stats table is hidden initially"
|
||||
);
|
||||
toggleTexts.push(getToggleText());
|
||||
toggleButton.click();
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => table.style.display === "",
|
||||
"Stats table is shown after first toggle"
|
||||
);
|
||||
toggleTexts.push(getToggleText());
|
||||
toggleButton.click();
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => table.style.display === "none",
|
||||
"Stats table is hidden after second toggle"
|
||||
);
|
||||
toggleTexts.push(getToggleText());
|
||||
return toggleTexts;
|
||||
});
|
||||
const [initialToggleText, toggleTextAfterShow, toggleTextAfterHide] =
|
||||
await SpecialPowers.spawn(browser, [], async function () {
|
||||
const toggleButton = content.document.getElementById(
|
||||
"place-database-stats-toggle"
|
||||
);
|
||||
const getToggleText = () =>
|
||||
content.document.l10n.getAttributes(toggleButton).id;
|
||||
const toggleTexts = [];
|
||||
const table = content.document.getElementById(
|
||||
"place-database-stats-tbody"
|
||||
);
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => table.style.display === "none",
|
||||
"Stats table is hidden initially"
|
||||
);
|
||||
toggleTexts.push(getToggleText());
|
||||
toggleButton.click();
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => table.style.display === "",
|
||||
"Stats table is shown after first toggle"
|
||||
);
|
||||
toggleTexts.push(getToggleText());
|
||||
toggleButton.click();
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => table.style.display === "none",
|
||||
"Stats table is hidden after second toggle"
|
||||
);
|
||||
toggleTexts.push(getToggleText());
|
||||
return toggleTexts;
|
||||
});
|
||||
Assert.equal(initialToggleText, "place-database-stats-show");
|
||||
Assert.equal(toggleTextAfterShow, "place-database-stats-hide");
|
||||
Assert.equal(toggleTextAfterHide, "place-database-stats-show");
|
||||
|
@ -4,28 +4,29 @@
|
||||
|
||||
add_task(async function test() {
|
||||
const URL = "data:text/html,<iframe width='700' height='700'></iframe>";
|
||||
await BrowserTestUtils.withNewTab({ gBrowser, url: URL }, async function (
|
||||
browser
|
||||
) {
|
||||
let context = await SpecialPowers.spawn(browser, [], function () {
|
||||
let iframe = content.document.querySelector("iframe");
|
||||
iframe.src = "https://expired.example.com/";
|
||||
return BrowsingContext.getFromWindow(iframe.contentWindow);
|
||||
});
|
||||
await TestUtils.waitForCondition(() => {
|
||||
let frame = context.currentWindowGlobal;
|
||||
return frame && frame.documentURI.spec.startsWith("about:certerror");
|
||||
});
|
||||
await SpecialPowers.spawn(context, [], async function () {
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => content.document.readyState == "interactive"
|
||||
);
|
||||
let aP = content.document.getElementById("badCertAdvancedPanel");
|
||||
Assert.ok(aP, "Advanced content should exist");
|
||||
Assert.ok(
|
||||
ContentTaskUtils.is_hidden(aP),
|
||||
"Advanced content should not be visible by default"
|
||||
);
|
||||
});
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: URL },
|
||||
async function (browser) {
|
||||
let context = await SpecialPowers.spawn(browser, [], function () {
|
||||
let iframe = content.document.querySelector("iframe");
|
||||
iframe.src = "https://expired.example.com/";
|
||||
return BrowsingContext.getFromWindow(iframe.contentWindow);
|
||||
});
|
||||
await TestUtils.waitForCondition(() => {
|
||||
let frame = context.currentWindowGlobal;
|
||||
return frame && frame.documentURI.spec.startsWith("about:certerror");
|
||||
});
|
||||
await SpecialPowers.spawn(context, [], async function () {
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => content.document.readyState == "interactive"
|
||||
);
|
||||
let aP = content.document.getElementById("badCertAdvancedPanel");
|
||||
Assert.ok(aP, "Advanced content should exist");
|
||||
Assert.ok(
|
||||
ContentTaskUtils.is_hidden(aP),
|
||||
"Advanced content should not be visible by default"
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -52,17 +52,15 @@ add_task(async function test_notificationClose() {
|
||||
return;
|
||||
}
|
||||
|
||||
let alertTitleLabel = alertWindow.document.getElementById(
|
||||
"alertTitleLabel"
|
||||
);
|
||||
let alertTitleLabel =
|
||||
alertWindow.document.getElementById("alertTitleLabel");
|
||||
is(
|
||||
alertTitleLabel.value,
|
||||
"Test title",
|
||||
"Title text of notification should be present"
|
||||
);
|
||||
let alertTextLabel = alertWindow.document.getElementById(
|
||||
"alertTextLabel"
|
||||
);
|
||||
let alertTextLabel =
|
||||
alertWindow.document.getElementById("alertTextLabel");
|
||||
is(
|
||||
alertTextLabel.textContent,
|
||||
"Test body 2",
|
||||
|
@ -35,20 +35,22 @@ add_task(async function test_notificationPreventDefaultAndSwitchTabs() {
|
||||
|
||||
// First, show a notification that will be have the tab-switching prevented.
|
||||
function promiseNotificationEvent(evt) {
|
||||
return SpecialPowers.spawn(aBrowser, [evt], async function (
|
||||
contentEvt
|
||||
) {
|
||||
return new Promise(resolve => {
|
||||
let contentNotification = content.wrappedJSObject._notification;
|
||||
contentNotification.addEventListener(
|
||||
contentEvt,
|
||||
function (event) {
|
||||
resolve({ defaultPrevented: event.defaultPrevented });
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
});
|
||||
});
|
||||
return SpecialPowers.spawn(
|
||||
aBrowser,
|
||||
[evt],
|
||||
async function (contentEvt) {
|
||||
return new Promise(resolve => {
|
||||
let contentNotification = content.wrappedJSObject._notification;
|
||||
contentNotification.addEventListener(
|
||||
contentEvt,
|
||||
function (event) {
|
||||
resolve({ defaultPrevented: event.defaultPrevented });
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
await openNotification(aBrowser, "showNotification1");
|
||||
info("Notification alert showing");
|
||||
|
@ -39,30 +39,31 @@ function promiseWindowClosed(window) {
|
||||
*/
|
||||
function openNotification(aBrowser, fn, timeout) {
|
||||
info(`openNotification: ${fn}`);
|
||||
return SpecialPowers.spawn(aBrowser, [[fn, timeout]], async function ([
|
||||
contentFn,
|
||||
contentTimeout,
|
||||
]) {
|
||||
await new Promise((resolve, reject) => {
|
||||
let win = content.wrappedJSObject;
|
||||
let notification = win[contentFn]();
|
||||
win._notification = notification;
|
||||
return SpecialPowers.spawn(
|
||||
aBrowser,
|
||||
[[fn, timeout]],
|
||||
async function ([contentFn, contentTimeout]) {
|
||||
await new Promise((resolve, reject) => {
|
||||
let win = content.wrappedJSObject;
|
||||
let notification = win[contentFn]();
|
||||
win._notification = notification;
|
||||
|
||||
function listener() {
|
||||
notification.removeEventListener("show", listener);
|
||||
resolve();
|
||||
}
|
||||
|
||||
notification.addEventListener("show", listener);
|
||||
|
||||
if (contentTimeout) {
|
||||
content.setTimeout(() => {
|
||||
function listener() {
|
||||
notification.removeEventListener("show", listener);
|
||||
reject("timed out");
|
||||
}, contentTimeout);
|
||||
}
|
||||
});
|
||||
});
|
||||
resolve();
|
||||
}
|
||||
|
||||
notification.addEventListener("show", listener);
|
||||
|
||||
if (contentTimeout) {
|
||||
content.setTimeout(() => {
|
||||
notification.removeEventListener("show", listener);
|
||||
reject("timed out");
|
||||
}, contentTimeout);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function closeNotification(aBrowser) {
|
||||
|
@ -51,19 +51,21 @@ async function testBackForwardMenu(useContextMenu) {
|
||||
for (let iter = 2; iter <= 4; iter++) {
|
||||
// Iterate three times. For the first two times through the loop, add a new history item.
|
||||
// But for the last iteration, go back in the history instead.
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [iter], async function (
|
||||
iterChild
|
||||
) {
|
||||
if (iterChild == 4) {
|
||||
let popStatePromise = new Promise(function (resolve) {
|
||||
content.onpopstate = resolve;
|
||||
});
|
||||
content.history.back();
|
||||
await popStatePromise;
|
||||
} else {
|
||||
content.history.pushState({}, "" + iterChild, iterChild + ".html");
|
||||
await SpecialPowers.spawn(
|
||||
gBrowser.selectedBrowser,
|
||||
[iter],
|
||||
async function (iterChild) {
|
||||
if (iterChild == 4) {
|
||||
let popStatePromise = new Promise(function (resolve) {
|
||||
content.onpopstate = resolve;
|
||||
});
|
||||
content.history.back();
|
||||
await popStatePromise;
|
||||
} else {
|
||||
content.history.pushState({}, "" + iterChild, iterChild + ".html");
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
// Wait for the session data to be flushed before continuing the test
|
||||
await new Promise(resolve =>
|
||||
|
@ -16,7 +16,8 @@ add_task(async function test_nullPrincipal() {
|
||||
const uri = 0;
|
||||
const suffix = 1;
|
||||
|
||||
const nullReplaceRegex = /moz-nullprincipal:{[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}}/;
|
||||
const nullReplaceRegex =
|
||||
/moz-nullprincipal:{[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}}/;
|
||||
const NULL_REPLACE = "NULL_PRINCIPAL_URL";
|
||||
|
||||
/*
|
||||
|
@ -53,28 +53,29 @@ add_task(async function test_contentarea_contextmenu_touch() {
|
||||
// Test the back and forward buttons.
|
||||
add_task(async function test_back_forward_button_contextmenu_touch() {
|
||||
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
||||
await BrowserTestUtils.withNewTab("http://example.com", async function (
|
||||
browser
|
||||
) {
|
||||
let contextMenu = document.getElementById("backForwardMenu");
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"http://example.com",
|
||||
async function (browser) {
|
||||
let contextMenu = document.getElementById("backForwardMenu");
|
||||
|
||||
let backbutton = document.getElementById("back-button");
|
||||
let notDisabled = TestUtils.waitForCondition(
|
||||
() => !backbutton.hasAttribute("disabled")
|
||||
);
|
||||
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.org");
|
||||
await notDisabled;
|
||||
await openAndCheckContextMenu(contextMenu, backbutton);
|
||||
let backbutton = document.getElementById("back-button");
|
||||
let notDisabled = TestUtils.waitForCondition(
|
||||
() => !backbutton.hasAttribute("disabled")
|
||||
);
|
||||
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.org");
|
||||
await notDisabled;
|
||||
await openAndCheckContextMenu(contextMenu, backbutton);
|
||||
|
||||
let forwardbutton = document.getElementById("forward-button");
|
||||
notDisabled = TestUtils.waitForCondition(
|
||||
() => !forwardbutton.hasAttribute("disabled")
|
||||
);
|
||||
backbutton.click();
|
||||
await notDisabled;
|
||||
await openAndCheckContextMenu(contextMenu, forwardbutton);
|
||||
});
|
||||
let forwardbutton = document.getElementById("forward-button");
|
||||
notDisabled = TestUtils.waitForCondition(
|
||||
() => !forwardbutton.hasAttribute("disabled")
|
||||
);
|
||||
backbutton.click();
|
||||
await notDisabled;
|
||||
await openAndCheckContextMenu(contextMenu, forwardbutton);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test the toolbar context menu.
|
||||
|
@ -400,32 +400,34 @@ add_task(async function () {
|
||||
for (let stepIndex = 0; stepIndex < steps.length; stepIndex++) {
|
||||
let step = steps[stepIndex];
|
||||
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [step], async function (
|
||||
contentStep
|
||||
) {
|
||||
return new Promise(resolve => {
|
||||
let changedWin = content;
|
||||
await SpecialPowers.spawn(
|
||||
gBrowser.selectedBrowser,
|
||||
[step],
|
||||
async function (contentStep) {
|
||||
return new Promise(resolve => {
|
||||
let changedWin = content;
|
||||
|
||||
let elem;
|
||||
if (contentStep[0] == "select") {
|
||||
changedWin = content.document.getElementById("frame").contentWindow;
|
||||
elem = changedWin.document.getElementById("select");
|
||||
} else {
|
||||
elem = content.document.getElementById(contentStep[0]);
|
||||
}
|
||||
let elem;
|
||||
if (contentStep[0] == "select") {
|
||||
changedWin = content.document.getElementById("frame").contentWindow;
|
||||
elem = changedWin.document.getElementById("select");
|
||||
} else {
|
||||
elem = content.document.getElementById(contentStep[0]);
|
||||
}
|
||||
|
||||
changedWin.addEventListener(
|
||||
"MozAfterPaint",
|
||||
function () {
|
||||
resolve();
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
changedWin.addEventListener(
|
||||
"MozAfterPaint",
|
||||
function () {
|
||||
resolve();
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
|
||||
elem.style = contentStep[1];
|
||||
elem.getBoundingClientRect();
|
||||
});
|
||||
});
|
||||
elem.style = contentStep[1];
|
||||
elem.getBoundingClientRect();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
await openSelectPopup();
|
||||
|
||||
|
@ -684,8 +684,9 @@ add_task(
|
||||
|
||||
await testSelectColors("SELECT_LONG_WITH_TRANSITION", 76, options);
|
||||
|
||||
let selectPopup = document.getElementById("ContentSelectDropdown")
|
||||
.menupopup;
|
||||
let selectPopup = document.getElementById(
|
||||
"ContentSelectDropdown"
|
||||
).menupopup;
|
||||
let scrollBox = selectPopup.scrollBox;
|
||||
is(
|
||||
scrollBox.scrollTop,
|
||||
|
@ -262,13 +262,15 @@ async function performLargePopupTests(win) {
|
||||
browser,
|
||||
"MozAfterPaint"
|
||||
);
|
||||
await SpecialPowers.spawn(browser, [position], async function (
|
||||
contentPosition
|
||||
) {
|
||||
let select = content.document.getElementById("one");
|
||||
select.setAttribute("style", contentPosition || "");
|
||||
select.getBoundingClientRect();
|
||||
});
|
||||
await SpecialPowers.spawn(
|
||||
browser,
|
||||
[position],
|
||||
async function (contentPosition) {
|
||||
let select = content.document.getElementById("one");
|
||||
select.setAttribute("style", contentPosition || "");
|
||||
select.getBoundingClientRect();
|
||||
}
|
||||
);
|
||||
await contentPainted;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,8 @@ add_task(async function () {
|
||||
selectedBrowser.loadURI(
|
||||
Services.io.newURI("data:text/html,<h1 id='h1'>Select Me</h1>"),
|
||||
{
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
triggeringPrincipal:
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -26,9 +26,8 @@ async function expectFocusOnF6(
|
||||
[expectedElement],
|
||||
async function (expectedElementId) {
|
||||
content.lastResult = "";
|
||||
let contentExpectedElement = content.document.getElementById(
|
||||
expectedElementId
|
||||
);
|
||||
let contentExpectedElement =
|
||||
content.document.getElementById(expectedElementId);
|
||||
if (!contentExpectedElement) {
|
||||
// Element not found, so look in the child frames.
|
||||
for (let f = 0; f < content.frames.length; f++) {
|
||||
|
@ -1,10 +1,11 @@
|
||||
function test() {
|
||||
var ids = {};
|
||||
Array.prototype.forEach.call(document.querySelectorAll("[id]"), function (
|
||||
node
|
||||
) {
|
||||
var id = node.id;
|
||||
ok(!(id in ids), id + " should be unique");
|
||||
ids[id] = null;
|
||||
});
|
||||
Array.prototype.forEach.call(
|
||||
document.querySelectorAll("[id]"),
|
||||
function (node) {
|
||||
var id = node.id;
|
||||
ok(!(id in ids), id + " should be unique");
|
||||
ids[id] = null;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -33,9 +33,8 @@ add_task(async function () {
|
||||
ok(homeButton, "home button present");
|
||||
|
||||
async function drop(dragData, homepage) {
|
||||
let setHomepageDialogPromise = BrowserTestUtils.promiseAlertDialogOpen(
|
||||
"accept"
|
||||
);
|
||||
let setHomepageDialogPromise =
|
||||
BrowserTestUtils.promiseAlertDialogOpen("accept");
|
||||
let setHomepagePromise = TestUtils.waitForPrefChange(
|
||||
HOMEPAGE_PREF,
|
||||
newVal => newVal == homepage
|
||||
@ -108,8 +107,7 @@ add_task(async function () {
|
||||
[
|
||||
{
|
||||
type: "text/plain",
|
||||
data:
|
||||
"http://mochi.test:8888/\nhttp://mochi.test:8888/b\nhttp://mochi.test:8888/c",
|
||||
data: "http://mochi.test:8888/\nhttp://mochi.test:8888/b\nhttp://mochi.test:8888/c",
|
||||
},
|
||||
],
|
||||
],
|
||||
|
@ -23,29 +23,31 @@ const PREF = "accessibility.blockautorefresh";
|
||||
* @returns Promise
|
||||
*/
|
||||
async function attemptFakeRefresh(browser, expectRefresh) {
|
||||
await SpecialPowers.spawn(browser, [expectRefresh], async function (
|
||||
contentExpectRefresh
|
||||
) {
|
||||
let URI = docShell.QueryInterface(Ci.nsIWebNavigation).currentURI;
|
||||
let refresher = docShell.QueryInterface(Ci.nsIRefreshURI);
|
||||
refresher.refreshURI(URI, null, 0);
|
||||
await SpecialPowers.spawn(
|
||||
browser,
|
||||
[expectRefresh],
|
||||
async function (contentExpectRefresh) {
|
||||
let URI = docShell.QueryInterface(Ci.nsIWebNavigation).currentURI;
|
||||
let refresher = docShell.QueryInterface(Ci.nsIRefreshURI);
|
||||
refresher.refreshURI(URI, null, 0);
|
||||
|
||||
Assert.equal(
|
||||
refresher.refreshPending,
|
||||
contentExpectRefresh,
|
||||
"Got the right refreshPending state"
|
||||
);
|
||||
Assert.equal(
|
||||
refresher.refreshPending,
|
||||
contentExpectRefresh,
|
||||
"Got the right refreshPending state"
|
||||
);
|
||||
|
||||
if (refresher.refreshPending) {
|
||||
// Cancel the pending refresh
|
||||
refresher.cancelRefreshURITimers();
|
||||
if (refresher.refreshPending) {
|
||||
// Cancel the pending refresh
|
||||
refresher.cancelRefreshURITimers();
|
||||
}
|
||||
|
||||
// The RefreshBlocker will wait until onLocationChange has
|
||||
// been fired before it will show any notifications (see bug
|
||||
// 1246291), so we cause this to occur manually here.
|
||||
content.location = URI.spec + "#foo";
|
||||
}
|
||||
|
||||
// The RefreshBlocker will wait until onLocationChange has
|
||||
// been fired before it will show any notifications (see bug
|
||||
// 1246291), so we cause this to occur manually here.
|
||||
content.location = URI.spec + "#foo";
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,47 +138,49 @@ add_task(async function testPageActionsButtonPress() {
|
||||
|
||||
// Test activation of the Back and Forward buttons from the keyboard.
|
||||
add_task(async function testBackForwardButtonPress() {
|
||||
await BrowserTestUtils.withNewTab("https://example.com/1", async function (
|
||||
aBrowser
|
||||
) {
|
||||
BrowserTestUtils.loadURIString(aBrowser, "https://example.com/2");
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"https://example.com/1",
|
||||
async function (aBrowser) {
|
||||
BrowserTestUtils.loadURIString(aBrowser, "https://example.com/2");
|
||||
|
||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||
let backButton = document.getElementById("back-button");
|
||||
forceFocus(backButton);
|
||||
let onLocationChange = waitForLocationChange();
|
||||
EventUtils.synthesizeKey(" ");
|
||||
await onLocationChange;
|
||||
ok(true, "Location changed after back button pressed");
|
||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||
let backButton = document.getElementById("back-button");
|
||||
forceFocus(backButton);
|
||||
let onLocationChange = waitForLocationChange();
|
||||
EventUtils.synthesizeKey(" ");
|
||||
await onLocationChange;
|
||||
ok(true, "Location changed after back button pressed");
|
||||
|
||||
let forwardButton = document.getElementById("forward-button");
|
||||
forceFocus(forwardButton);
|
||||
onLocationChange = waitForLocationChange();
|
||||
EventUtils.synthesizeKey(" ");
|
||||
await onLocationChange;
|
||||
ok(true, "Location changed after forward button pressed");
|
||||
});
|
||||
let forwardButton = document.getElementById("forward-button");
|
||||
forceFocus(forwardButton);
|
||||
onLocationChange = waitForLocationChange();
|
||||
EventUtils.synthesizeKey(" ");
|
||||
await onLocationChange;
|
||||
ok(true, "Location changed after forward button pressed");
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test activation of the Reload button from the keyboard.
|
||||
// This is a toolbarbutton with a click handler and no command handler, but
|
||||
// the toolbar keyboard navigation code should handle keyboard activation.
|
||||
add_task(async function testReloadButtonPress() {
|
||||
await BrowserTestUtils.withNewTab("https://example.com/1", async function (
|
||||
aBrowser
|
||||
) {
|
||||
let button = document.getElementById("reload-button");
|
||||
info("Waiting for button to be enabled.");
|
||||
await TestUtils.waitForCondition(() => !button.disabled);
|
||||
let loaded = BrowserTestUtils.browserLoaded(aBrowser);
|
||||
info("Focusing button");
|
||||
forceFocus(button);
|
||||
info("Pressing space on the button");
|
||||
EventUtils.synthesizeKey(" ");
|
||||
info("Waiting for load.");
|
||||
await loaded;
|
||||
ok(true, "Page loaded after Reload button pressed");
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"https://example.com/1",
|
||||
async function (aBrowser) {
|
||||
let button = document.getElementById("reload-button");
|
||||
info("Waiting for button to be enabled.");
|
||||
await TestUtils.waitForCondition(() => !button.disabled);
|
||||
let loaded = BrowserTestUtils.browserLoaded(aBrowser);
|
||||
info("Focusing button");
|
||||
forceFocus(button);
|
||||
info("Pressing space on the button");
|
||||
EventUtils.synthesizeKey(" ");
|
||||
info("Waiting for load.");
|
||||
await loaded;
|
||||
ok(true, "Page loaded after Reload button pressed");
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test activation of the Sidebars button from the keyboard.
|
||||
@ -212,26 +214,30 @@ add_task(async function testSidebarsButtonPress() {
|
||||
// This is an image with a click handler on its parent and no command handler,
|
||||
// but the toolbar keyboard navigation code should handle keyboard activation.
|
||||
add_task(async function testBookmarkButtonPress() {
|
||||
await BrowserTestUtils.withNewTab("https://example.com", async function (
|
||||
aBrowser
|
||||
) {
|
||||
let button = document.getElementById("star-button-box");
|
||||
forceFocus(button);
|
||||
StarUI._createPanelIfNeeded();
|
||||
let panel = document.getElementById("editBookmarkPanel");
|
||||
let focused = BrowserTestUtils.waitForEvent(panel, "focus", true);
|
||||
// The button ignores activation while the bookmarked status is being
|
||||
// updated. So, wait for it to finish updating.
|
||||
await TestUtils.waitForCondition(
|
||||
() => BookmarkingUI.status != BookmarkingUI.STATUS_UPDATING
|
||||
);
|
||||
EventUtils.synthesizeKey(" ");
|
||||
await focused;
|
||||
ok(true, "Focus inside edit bookmark panel after Bookmark button pressed");
|
||||
let hidden = BrowserTestUtils.waitForEvent(panel, "popuphidden");
|
||||
EventUtils.synthesizeKey("KEY_Escape");
|
||||
await hidden;
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"https://example.com",
|
||||
async function (aBrowser) {
|
||||
let button = document.getElementById("star-button-box");
|
||||
forceFocus(button);
|
||||
StarUI._createPanelIfNeeded();
|
||||
let panel = document.getElementById("editBookmarkPanel");
|
||||
let focused = BrowserTestUtils.waitForEvent(panel, "focus", true);
|
||||
// The button ignores activation while the bookmarked status is being
|
||||
// updated. So, wait for it to finish updating.
|
||||
await TestUtils.waitForCondition(
|
||||
() => BookmarkingUI.status != BookmarkingUI.STATUS_UPDATING
|
||||
);
|
||||
EventUtils.synthesizeKey(" ");
|
||||
await focused;
|
||||
ok(
|
||||
true,
|
||||
"Focus inside edit bookmark panel after Bookmark button pressed"
|
||||
);
|
||||
let hidden = BrowserTestUtils.waitForEvent(panel, "popuphidden");
|
||||
EventUtils.synthesizeKey("KEY_Escape");
|
||||
await hidden;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test activation of the Bookmarks Menu button from the keyboard.
|
||||
@ -299,27 +305,32 @@ add_task(async function testDownloadsButtonPress() {
|
||||
// with a browser element to embed the pocket UI into it.
|
||||
// The Pocket panel should appear and focus should move inside it.
|
||||
add_task(async function testPocketButtonPress() {
|
||||
await BrowserTestUtils.withNewTab("https://example.com", async function (
|
||||
aBrowser
|
||||
) {
|
||||
let button = document.getElementById("save-to-pocket-button");
|
||||
forceFocus(button);
|
||||
// The panel is created on the fly, so we can't simply wait for focus
|
||||
// inside it.
|
||||
let showing = BrowserTestUtils.waitForEvent(document, "popupshowing", true);
|
||||
EventUtils.synthesizeKey(" ");
|
||||
let event = await showing;
|
||||
let panel = event.target;
|
||||
is(panel.id, "customizationui-widget-panel");
|
||||
let focused = BrowserTestUtils.waitForEvent(panel, "focus", true);
|
||||
await focused;
|
||||
is(
|
||||
document.activeElement.tagName,
|
||||
"browser",
|
||||
"Focus inside Pocket panel after Bookmark button pressed"
|
||||
);
|
||||
let hidden = BrowserTestUtils.waitForEvent(panel, "popuphidden");
|
||||
EventUtils.synthesizeKey("KEY_Escape");
|
||||
await hidden;
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"https://example.com",
|
||||
async function (aBrowser) {
|
||||
let button = document.getElementById("save-to-pocket-button");
|
||||
forceFocus(button);
|
||||
// The panel is created on the fly, so we can't simply wait for focus
|
||||
// inside it.
|
||||
let showing = BrowserTestUtils.waitForEvent(
|
||||
document,
|
||||
"popupshowing",
|
||||
true
|
||||
);
|
||||
EventUtils.synthesizeKey(" ");
|
||||
let event = await showing;
|
||||
let panel = event.target;
|
||||
is(panel.id, "customizationui-widget-panel");
|
||||
let focused = BrowserTestUtils.waitForEvent(panel, "focus", true);
|
||||
await focused;
|
||||
is(
|
||||
document.activeElement.tagName,
|
||||
"browser",
|
||||
"Focus inside Pocket panel after Bookmark button pressed"
|
||||
);
|
||||
let hidden = BrowserTestUtils.waitForEvent(panel, "popuphidden");
|
||||
EventUtils.synthesizeKey("KEY_Escape");
|
||||
await hidden;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -192,24 +192,25 @@ add_task(async function testTabStopsPageLoaded() {
|
||||
// Test tab stops with a notification anchor visible.
|
||||
// The notification anchor should not get its own tab stop.
|
||||
add_task(async function testTabStopsWithNotification() {
|
||||
await BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function (
|
||||
aBrowser
|
||||
) {
|
||||
let popupShown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
// Request a permission.
|
||||
BrowserTestUtils.synthesizeMouseAtCenter("#geo", {}, aBrowser);
|
||||
await popupShown;
|
||||
startFromUrlBar();
|
||||
// If the notification anchor were in the tab order, the next shift+tab
|
||||
// would focus it instead of #tracking-protection-icon-container.
|
||||
await expectFocusAfterKey(
|
||||
"Shift+Tab",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(
|
||||
PERMISSIONS_PAGE,
|
||||
async function (aBrowser) {
|
||||
let popupShown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
// Request a permission.
|
||||
BrowserTestUtils.synthesizeMouseAtCenter("#geo", {}, aBrowser);
|
||||
await popupShown;
|
||||
startFromUrlBar();
|
||||
// If the notification anchor were in the tab order, the next shift+tab
|
||||
// would focus it instead of #tracking-protection-icon-container.
|
||||
await expectFocusAfterKey(
|
||||
"Shift+Tab",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test tab stops with the Bookmarks toolbar visible.
|
||||
@ -296,36 +297,37 @@ add_task(async function testArrowsRoleButton() {
|
||||
|
||||
// Test that right/left arrows do not land on disabled buttons.
|
||||
add_task(async function testArrowsDisabledButtons() {
|
||||
await BrowserTestUtils.withNewTab("https://example.com", async function (
|
||||
aBrowser
|
||||
) {
|
||||
await waitUntilReloadEnabled();
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey(
|
||||
"Shift+Tab",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
// Back and Forward buttons are disabled.
|
||||
await expectFocusAfterKey("Shift+Tab", "reload-button");
|
||||
EventUtils.synthesizeKey("KEY_ArrowLeft");
|
||||
is(
|
||||
document.activeElement.id,
|
||||
"reload-button",
|
||||
"ArrowLeft on Reload button when prior buttons disabled does nothing"
|
||||
);
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"https://example.com",
|
||||
async function (aBrowser) {
|
||||
await waitUntilReloadEnabled();
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey(
|
||||
"Shift+Tab",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
// Back and Forward buttons are disabled.
|
||||
await expectFocusAfterKey("Shift+Tab", "reload-button");
|
||||
EventUtils.synthesizeKey("KEY_ArrowLeft");
|
||||
is(
|
||||
document.activeElement.id,
|
||||
"reload-button",
|
||||
"ArrowLeft on Reload button when prior buttons disabled does nothing"
|
||||
);
|
||||
|
||||
BrowserTestUtils.loadURIString(aBrowser, "https://example.com/2");
|
||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||
await waitUntilReloadEnabled();
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey(
|
||||
"Shift+Tab",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
await expectFocusAfterKey("Shift+Tab", "back-button");
|
||||
// Forward button is still disabled.
|
||||
await expectFocusAfterKey("ArrowRight", "reload-button");
|
||||
});
|
||||
BrowserTestUtils.loadURIString(aBrowser, "https://example.com/2");
|
||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||
await waitUntilReloadEnabled();
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey(
|
||||
"Shift+Tab",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
await expectFocusAfterKey("Shift+Tab", "back-button");
|
||||
// Forward button is still disabled.
|
||||
await expectFocusAfterKey("ArrowRight", "reload-button");
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test that right arrow reaches the overflow menu button when it is visible.
|
||||
@ -464,26 +466,27 @@ add_task(async function testPanelCloseRestoresFocus() {
|
||||
// Test that the arrow key works in the group of the
|
||||
// 'tracking-protection-icon-container' and the 'identity-box'.
|
||||
add_task(async function testArrowKeyForTPIconContainerandIdentityBox() {
|
||||
await BrowserTestUtils.withNewTab("https://example.com", async function (
|
||||
browser
|
||||
) {
|
||||
// Simulate geo sharing so the permission box shows
|
||||
gBrowser.updateBrowserSharing(browser, { geo: true });
|
||||
await waitUntilReloadEnabled();
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey(
|
||||
"Shift+Tab",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
await expectFocusAfterKey("ArrowRight", "identity-icon-box");
|
||||
await expectFocusAfterKey("ArrowRight", "identity-permission-box");
|
||||
await expectFocusAfterKey("ArrowLeft", "identity-icon-box");
|
||||
await expectFocusAfterKey(
|
||||
"ArrowLeft",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
gBrowser.updateBrowserSharing(browser, { geo: false });
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"https://example.com",
|
||||
async function (browser) {
|
||||
// Simulate geo sharing so the permission box shows
|
||||
gBrowser.updateBrowserSharing(browser, { geo: true });
|
||||
await waitUntilReloadEnabled();
|
||||
startFromUrlBar();
|
||||
await expectFocusAfterKey(
|
||||
"Shift+Tab",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
await expectFocusAfterKey("ArrowRight", "identity-icon-box");
|
||||
await expectFocusAfterKey("ArrowRight", "identity-permission-box");
|
||||
await expectFocusAfterKey("ArrowLeft", "identity-icon-box");
|
||||
await expectFocusAfterKey(
|
||||
"ArrowLeft",
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
gBrowser.updateBrowserSharing(browser, { geo: false });
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test navigation by typed characters.
|
||||
@ -570,63 +573,65 @@ add_task(async function testFirefoxViewButtonNavigation() {
|
||||
// selected tab and the new-tab button.
|
||||
// Finally, assert that focus is restored to web content when
|
||||
// navigating backwards from the Firefox View button.
|
||||
await BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function (
|
||||
aBrowser
|
||||
) {
|
||||
await SpecialPowers.spawn(aBrowser, [], async () => {
|
||||
content.document.querySelector("#camera").focus();
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(
|
||||
PERMISSIONS_PAGE,
|
||||
async function (aBrowser) {
|
||||
await SpecialPowers.spawn(aBrowser, [], async () => {
|
||||
content.document.querySelector("#camera").focus();
|
||||
});
|
||||
|
||||
await expectFocusAfterKey("Tab", "firefox-view-button");
|
||||
let selectedTab = document.querySelector("tab[selected]");
|
||||
await expectFocusAfterKey("Tab", selectedTab);
|
||||
await expectFocusAfterKey("Tab", "new-tab-button");
|
||||
await expectFocusAfterKey("Shift+Tab", selectedTab);
|
||||
await expectFocusAfterKey("Shift+Tab", "firefox-view-button");
|
||||
await expectFocusAfterKey("Tab", "firefox-view-button");
|
||||
let selectedTab = document.querySelector("tab[selected]");
|
||||
await expectFocusAfterKey("Tab", selectedTab);
|
||||
await expectFocusAfterKey("Tab", "new-tab-button");
|
||||
await expectFocusAfterKey("Shift+Tab", selectedTab);
|
||||
await expectFocusAfterKey("Shift+Tab", "firefox-view-button");
|
||||
|
||||
// Moving from toolbar back into content
|
||||
EventUtils.synthesizeKey("KEY_Tab", { shiftKey: true });
|
||||
await SpecialPowers.spawn(aBrowser, [], async () => {
|
||||
let activeElement = content.document.activeElement;
|
||||
let expectedElement = content.document.querySelector("#camera");
|
||||
is(
|
||||
activeElement,
|
||||
expectedElement,
|
||||
"Focus should be returned to the 'camera' button"
|
||||
);
|
||||
});
|
||||
});
|
||||
// Moving from toolbar back into content
|
||||
EventUtils.synthesizeKey("KEY_Tab", { shiftKey: true });
|
||||
await SpecialPowers.spawn(aBrowser, [], async () => {
|
||||
let activeElement = content.document.activeElement;
|
||||
let expectedElement = content.document.querySelector("#camera");
|
||||
is(
|
||||
activeElement,
|
||||
expectedElement,
|
||||
"Focus should be returned to the 'camera' button"
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
// Assert that the selected tab receives focus before the new-tab button
|
||||
// if there is no Firefox View button.
|
||||
// Additionally, assert that navigating backwards from the selected tab
|
||||
// restores focus to the last element in the web content.
|
||||
await BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function (
|
||||
aBrowser
|
||||
) {
|
||||
removeFirefoxViewButton();
|
||||
await BrowserTestUtils.withNewTab(
|
||||
PERMISSIONS_PAGE,
|
||||
async function (aBrowser) {
|
||||
removeFirefoxViewButton();
|
||||
|
||||
await SpecialPowers.spawn(aBrowser, [], async () => {
|
||||
content.document.querySelector("#camera").focus();
|
||||
});
|
||||
await SpecialPowers.spawn(aBrowser, [], async () => {
|
||||
content.document.querySelector("#camera").focus();
|
||||
});
|
||||
|
||||
let selectedTab = document.querySelector("tab[selected]");
|
||||
await expectFocusAfterKey("Tab", selectedTab);
|
||||
await expectFocusAfterKey("Tab", "new-tab-button");
|
||||
await expectFocusAfterKey("Shift+Tab", selectedTab);
|
||||
let selectedTab = document.querySelector("tab[selected]");
|
||||
await expectFocusAfterKey("Tab", selectedTab);
|
||||
await expectFocusAfterKey("Tab", "new-tab-button");
|
||||
await expectFocusAfterKey("Shift+Tab", selectedTab);
|
||||
|
||||
// Moving from toolbar back into content
|
||||
EventUtils.synthesizeKey("KEY_Tab", { shiftKey: true });
|
||||
await SpecialPowers.spawn(aBrowser, [], async () => {
|
||||
let activeElement = content.document.activeElement;
|
||||
let expectedElement = content.document.querySelector("#camera");
|
||||
is(
|
||||
activeElement,
|
||||
expectedElement,
|
||||
"Focus should be returned to the 'camera' button"
|
||||
);
|
||||
});
|
||||
});
|
||||
// Moving from toolbar back into content
|
||||
EventUtils.synthesizeKey("KEY_Tab", { shiftKey: true });
|
||||
await SpecialPowers.spawn(aBrowser, [], async () => {
|
||||
let activeElement = content.document.activeElement;
|
||||
let expectedElement = content.document.querySelector("#camera");
|
||||
is(
|
||||
activeElement,
|
||||
expectedElement,
|
||||
"Focus should be returned to the 'camera' button"
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
// Clean up extra tabs
|
||||
while (gBrowser.tabs.length > 1) {
|
||||
|
@ -121,11 +121,12 @@ add_task(async function test_subframes_function() {
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
let counter = 0;
|
||||
let browsingContexts = await initChildFrames(browser, function (
|
||||
browsingContext
|
||||
) {
|
||||
return "<p>Text " + ++counter + "</p>";
|
||||
});
|
||||
let browsingContexts = await initChildFrames(
|
||||
browser,
|
||||
function (browsingContext) {
|
||||
return "<p>Text " + ++counter + "</p>";
|
||||
}
|
||||
);
|
||||
|
||||
is(
|
||||
counter,
|
||||
|
@ -69,9 +69,8 @@ async function initChildFrames(browser, insertHTML) {
|
||||
|
||||
if (insertHTMLChild) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.getElementById(
|
||||
"insertPoint"
|
||||
).innerHTML = insertHTMLChild;
|
||||
content.document.getElementById("insertPoint").innerHTML =
|
||||
insertHTMLChild;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -39,9 +39,8 @@ add_task(async function bookmark() {
|
||||
{ gBrowser: win.gBrowser, url },
|
||||
async () => {
|
||||
// The bookmark button should not be starred.
|
||||
const bookmarkButton = win.BrowserPageActions.urlbarButtonNodeForActionID(
|
||||
"bookmark"
|
||||
);
|
||||
const bookmarkButton =
|
||||
win.BrowserPageActions.urlbarButtonNodeForActionID("bookmark");
|
||||
Assert.ok(!bookmarkButton.hasAttribute("starred"));
|
||||
|
||||
info("Click the button.");
|
||||
|
@ -34,13 +34,11 @@ add_task(async function test() {
|
||||
await promiseAnimationFrame(win);
|
||||
|
||||
info("Check page action buttons are visible, the meatball button is not");
|
||||
let addonButton = win.BrowserPageActions.urlbarButtonNodeForActionID(
|
||||
actionId
|
||||
);
|
||||
let addonButton =
|
||||
win.BrowserPageActions.urlbarButtonNodeForActionID(actionId);
|
||||
Assert.ok(BrowserTestUtils.is_visible(addonButton));
|
||||
let starButton = win.BrowserPageActions.urlbarButtonNodeForActionID(
|
||||
"bookmark"
|
||||
);
|
||||
let starButton =
|
||||
win.BrowserPageActions.urlbarButtonNodeForActionID("bookmark");
|
||||
Assert.ok(BrowserTestUtils.is_visible(starButton));
|
||||
let meatballButton = win.document.getElementById("pageActionButton");
|
||||
Assert.ok(!BrowserTestUtils.is_visible(meatballButton));
|
||||
@ -226,9 +224,8 @@ add_task(async function test_disabledPageAction_hidden_in_protonOverflowMenu() {
|
||||
extension.sendMessage("show-pageAction");
|
||||
await extension.awaitMessage("show-pageAction:done");
|
||||
await promisePageActionPanelOpen(win);
|
||||
let pageActionNode = win.BrowserPageActions.panelButtonNodeForActionID(
|
||||
widgetId
|
||||
);
|
||||
let pageActionNode =
|
||||
win.BrowserPageActions.panelButtonNodeForActionID(widgetId);
|
||||
ok(
|
||||
pageActionNode && BrowserTestUtils.is_visible(pageActionNode),
|
||||
"enabled pageAction should be visible in the urlbar overflow menu"
|
||||
|
@ -17,9 +17,8 @@ const WEB_ROOT = getRootDirectory(gTestPath).replace(
|
||||
*/
|
||||
function promiseStylesheetsLoaded(browser, styleSheetCount) {
|
||||
return TestUtils.waitForCondition(() => {
|
||||
let actor = browser.browsingContext?.currentWindowGlobal?.getActor(
|
||||
"PageStyle"
|
||||
);
|
||||
let actor =
|
||||
browser.browsingContext?.currentWindowGlobal?.getActor("PageStyle");
|
||||
if (!actor) {
|
||||
info("No jswindowactor (yet?)");
|
||||
return false;
|
||||
|
@ -1,17 +1,18 @@
|
||||
async function testPageInfo() {
|
||||
await BrowserTestUtils.withNewTab("https://example.com", async function (
|
||||
browser
|
||||
) {
|
||||
let pageInfo = BrowserPageInfo();
|
||||
await BrowserTestUtils.waitForEvent(pageInfo, "page-info-init");
|
||||
is(
|
||||
getComputedStyle(pageInfo.document.documentElement).direction,
|
||||
"rtl",
|
||||
"Should be RTL"
|
||||
);
|
||||
ok(true, "Didn't assert or crash");
|
||||
pageInfo.close();
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"https://example.com",
|
||||
async function (browser) {
|
||||
let pageInfo = BrowserPageInfo();
|
||||
await BrowserTestUtils.waitForEvent(pageInfo, "page-info-init");
|
||||
is(
|
||||
getComputedStyle(pageInfo.document.documentElement).direction,
|
||||
"rtl",
|
||||
"Should be RTL"
|
||||
);
|
||||
ok(true, "Didn't assert or crash");
|
||||
pageInfo.close();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
add_task(async function test_page_info_rtl() {
|
||||
|
@ -118,8 +118,8 @@ add_task(async function startup() {
|
||||
},
|
||||
};
|
||||
|
||||
let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService()
|
||||
.wrappedJSObject;
|
||||
let startupRecorder =
|
||||
Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
|
||||
await startupRecorder.done;
|
||||
|
||||
ok(startupRecorder.data.prefStats, "startupRecorder has prefStats");
|
||||
@ -203,12 +203,11 @@ add_task(async function navigate_around() {
|
||||
max: 51,
|
||||
};
|
||||
// This pref is only accessed in automation to speed up tests.
|
||||
knownProblematicPrefs[
|
||||
"dom.ipc.keepProcessesAlive.webIsolated.perOrigin"
|
||||
] = {
|
||||
min: 100,
|
||||
max: 102,
|
||||
};
|
||||
knownProblematicPrefs["dom.ipc.keepProcessesAlive.webIsolated.perOrigin"] =
|
||||
{
|
||||
min: 100,
|
||||
max: 102,
|
||||
};
|
||||
if (AppConstants.platform == "linux") {
|
||||
// The following sandbox pref is covered by
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1600189
|
||||
|
@ -140,8 +140,8 @@ add_task(async function () {
|
||||
return;
|
||||
}
|
||||
|
||||
let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService()
|
||||
.wrappedJSObject;
|
||||
let startupRecorder =
|
||||
Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
|
||||
await startupRecorder.done;
|
||||
|
||||
let data = Cu.cloneInto(startupRecorder.data.code, {});
|
||||
|
@ -248,8 +248,8 @@ add_task(async function () {
|
||||
|
||||
TestUtils.assertPackagedBuild();
|
||||
|
||||
let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService()
|
||||
.wrappedJSObject;
|
||||
let startupRecorder =
|
||||
Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
|
||||
await startupRecorder.done;
|
||||
|
||||
for (let process in processes) {
|
||||
|
@ -9,8 +9,8 @@
|
||||
*/
|
||||
|
||||
add_task(async function () {
|
||||
let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService()
|
||||
.wrappedJSObject;
|
||||
let startupRecorder =
|
||||
Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
|
||||
await startupRecorder.done;
|
||||
|
||||
// Ensure all the frame data is in the test compartment to avoid traversing
|
||||
|
@ -17,8 +17,8 @@ add_task(async function () {
|
||||
return;
|
||||
}
|
||||
|
||||
let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService()
|
||||
.wrappedJSObject;
|
||||
let startupRecorder =
|
||||
Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
|
||||
await startupRecorder.done;
|
||||
|
||||
let extras = Cu.cloneInto(startupRecorder.data.extras, {});
|
||||
|
@ -62,8 +62,8 @@ add_task(async function () {
|
||||
ok(false, "You need to run this test on a debug build.");
|
||||
}
|
||||
|
||||
let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService()
|
||||
.wrappedJSObject;
|
||||
let startupRecorder =
|
||||
Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
|
||||
await startupRecorder.done;
|
||||
|
||||
let data = Cu.cloneInto(startupRecorder.data.images, {});
|
||||
|
@ -653,8 +653,8 @@ add_task(async function () {
|
||||
|
||||
TestUtils.assertPackagedBuild();
|
||||
|
||||
let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService()
|
||||
.wrappedJSObject;
|
||||
let startupRecorder =
|
||||
Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
|
||||
await startupRecorder.done;
|
||||
|
||||
// Add system add-ons to the list of known IO dynamically.
|
||||
@ -691,9 +691,8 @@ add_task(async function () {
|
||||
for (let m of profile.markers.data) {
|
||||
let markerName = profile.stringTable[m[nameCol]];
|
||||
if (markerName.startsWith("startupRecorder:")) {
|
||||
phases[
|
||||
markerName.split("startupRecorder:")[1]
|
||||
] = markersForCurrentPhase;
|
||||
phases[markerName.split("startupRecorder:")[1]] =
|
||||
markersForCurrentPhase;
|
||||
markersForCurrentPhase = [];
|
||||
continue;
|
||||
}
|
||||
|
@ -342,8 +342,8 @@ add_task(async function () {
|
||||
return;
|
||||
}
|
||||
|
||||
let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService()
|
||||
.wrappedJSObject;
|
||||
let startupRecorder =
|
||||
Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
|
||||
await startupRecorder.done;
|
||||
|
||||
// Check for sync IPC markers in the startup profile.
|
||||
@ -359,9 +359,8 @@ add_task(async function () {
|
||||
for (let m of profile.markers.data) {
|
||||
let markerName = profile.stringTable[m[nameCol]];
|
||||
if (markerName.startsWith("startupRecorder:")) {
|
||||
phases[
|
||||
markerName.split("startupRecorder:")[1]
|
||||
] = markersForCurrentPhase;
|
||||
phases[markerName.split("startupRecorder:")[1]] =
|
||||
markersForCurrentPhase;
|
||||
markersForCurrentPhase = [];
|
||||
continue;
|
||||
}
|
||||
|
@ -35,8 +35,10 @@ add_task(async function () {
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
|
||||
await TestUtils.waitForCondition(() => tab._fullyOpen);
|
||||
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let newTabButtonRect = gBrowser.tabContainer.newTabButton.getBoundingClientRect();
|
||||
let tabStripRect =
|
||||
gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let newTabButtonRect =
|
||||
gBrowser.tabContainer.newTabButton.getBoundingClientRect();
|
||||
let inRange = (val, min, max) => min <= val && val <= max;
|
||||
|
||||
// Add a reflow observer and open a new tab.
|
||||
|
@ -52,7 +52,8 @@ add_task(async function () {
|
||||
let lastTab = gBrowser.tabs[gBrowser.tabs.length - 1];
|
||||
await BrowserTestUtils.switchTab(gBrowser, lastTab);
|
||||
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let tabStripRect =
|
||||
gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
|
||||
function isInTabStrip(r) {
|
||||
return (
|
||||
|
@ -44,7 +44,8 @@ add_task(async function () {
|
||||
// tab opening operation.
|
||||
gURLBar.focus();
|
||||
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let tabStripRect =
|
||||
gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
|
||||
let firstTabRect = gBrowser.selectedTab.getBoundingClientRect();
|
||||
let tabPaddingStart = parseFloat(
|
||||
@ -52,7 +53,8 @@ add_task(async function () {
|
||||
);
|
||||
let minTabWidth = firstTabRect.width - 2 * tabPaddingStart;
|
||||
let maxTabWidth = firstTabRect.width;
|
||||
let firstTabLabelRect = gBrowser.selectedTab.textLabel.getBoundingClientRect();
|
||||
let firstTabLabelRect =
|
||||
gBrowser.selectedTab.textLabel.getBoundingClientRect();
|
||||
let newTabButtonRect = document
|
||||
.getElementById("tabs-newtab-button")
|
||||
.getBoundingClientRect();
|
||||
@ -180,8 +182,7 @@ add_task(async function () {
|
||||
r.y2 <= textBoxRect.bottom,
|
||||
},
|
||||
{
|
||||
name:
|
||||
"bug 1477966 - the name of a deselected tab should appear immediately",
|
||||
name: "bug 1477966 - the name of a deselected tab should appear immediately",
|
||||
condition: r =>
|
||||
AppConstants.platform == "macosx" &&
|
||||
r.x1 >= firstTabLabelRect.x &&
|
||||
|
@ -43,7 +43,8 @@ add_task(async function () {
|
||||
|
||||
gURLBar.focus();
|
||||
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let tabStripRect =
|
||||
gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let textBoxRect = gURLBar
|
||||
.querySelector("moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
|
@ -48,7 +48,8 @@ add_task(async function () {
|
||||
gURLBar.focus();
|
||||
await disableFxaBadge();
|
||||
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let tabStripRect =
|
||||
gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let textBoxRect = gURLBar
|
||||
.querySelector("moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
|
@ -52,7 +52,8 @@ add_task(async function () {
|
||||
let otherTab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
|
||||
await firstSwitchDone;
|
||||
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let tabStripRect =
|
||||
gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let firstTabRect = origTab.getBoundingClientRect();
|
||||
let tabPaddingStart = parseFloat(
|
||||
getComputedStyle(gBrowser.selectedTab).paddingInlineStart
|
||||
|
@ -115,8 +115,7 @@ add_task(async function () {
|
||||
{
|
||||
// Note that the length and x values here are a bit weird because on
|
||||
// some fonts, we appear to detect the two words separately.
|
||||
name:
|
||||
"Initial bookmark text ('Getting Started' or 'Get Involved') appearing after startup",
|
||||
name: "Initial bookmark text ('Getting Started' or 'Get Involved') appearing after startup",
|
||||
condition: r =>
|
||||
inRange(r.w, 25, 120) && // length of text
|
||||
inRange(r.h, 9, 15) && // height of text
|
||||
|
@ -322,7 +322,8 @@ function computeMaxTabCount() {
|
||||
let currentTabCount = gBrowser.tabs.length;
|
||||
let newTabButton = gBrowser.tabContainer.newTabButton;
|
||||
let newTabRect = newTabButton.getBoundingClientRect();
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let tabStripRect =
|
||||
gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let availableTabStripWidth = tabStripRect.width - newTabRect.width;
|
||||
|
||||
let tabMinWidth = parseInt(
|
||||
|
@ -138,8 +138,10 @@ add_task(async function testMainViewVisible() {
|
||||
await closePermissionPopup();
|
||||
|
||||
let uri = Services.io.newURI(AUTOPLAY_PAGE);
|
||||
let state = PermissionTestUtils.getPermissionObject(uri, AUTOPLAY_PERM)
|
||||
.capability;
|
||||
let state = PermissionTestUtils.getPermissionObject(
|
||||
uri,
|
||||
AUTOPLAY_PERM
|
||||
).capability;
|
||||
Assert.equal(state, Services.perms.ALLOW_ACTION);
|
||||
});
|
||||
|
||||
@ -149,9 +151,10 @@ add_task(async function testMainViewVisible() {
|
||||
add_task(async function testGloballyBlockedOnNewWindow() {
|
||||
Services.prefs.setIntPref(AUTOPLAY_PREF, Ci.nsIAutoplay.BLOCKED);
|
||||
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
AUTOPLAY_PAGE
|
||||
);
|
||||
let principal =
|
||||
Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
AUTOPLAY_PAGE
|
||||
);
|
||||
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(
|
||||
gBrowser,
|
||||
|
@ -135,107 +135,112 @@ add_setup(async function () {
|
||||
// Test that temp blocked permissions in first party affect the third party
|
||||
// iframe.
|
||||
add_task(async function testUseTempPermissionsFirstParty() {
|
||||
await BrowserTestUtils.withNewTab(CROSS_SUBFRAME_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
SitePermissions.setForPrincipal(
|
||||
principal,
|
||||
"geo",
|
||||
SitePermissions.BLOCK,
|
||||
SitePermissions.SCOPE_TEMPORARY,
|
||||
browser
|
||||
);
|
||||
await BrowserTestUtils.withNewTab(
|
||||
CROSS_SUBFRAME_PAGE,
|
||||
async function (browser) {
|
||||
SitePermissions.setForPrincipal(
|
||||
principal,
|
||||
"geo",
|
||||
SitePermissions.BLOCK,
|
||||
SitePermissions.SCOPE_TEMPORARY,
|
||||
browser
|
||||
);
|
||||
|
||||
await checkGeolocation(browser, "frame", PromptResult.DENY);
|
||||
await checkGeolocation(browser, "frame", PromptResult.DENY);
|
||||
|
||||
SitePermissions.removeFromPrincipal(principal, "geo", browser);
|
||||
});
|
||||
SitePermissions.removeFromPrincipal(principal, "geo", browser);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test that persistent permissions in first party affect the third party
|
||||
// iframe.
|
||||
add_task(async function testUsePersistentPermissionsFirstParty() {
|
||||
await BrowserTestUtils.withNewTab(CROSS_SUBFRAME_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
async function checkPermission(aPermission, aExpect) {
|
||||
PermissionTestUtils.add(uri, "geo", aPermission);
|
||||
await checkGeolocation(browser, "frame", aExpect);
|
||||
await BrowserTestUtils.withNewTab(
|
||||
CROSS_SUBFRAME_PAGE,
|
||||
async function (browser) {
|
||||
async function checkPermission(aPermission, aExpect) {
|
||||
PermissionTestUtils.add(uri, "geo", aPermission);
|
||||
await checkGeolocation(browser, "frame", aExpect);
|
||||
|
||||
if (aExpect == PromptResult.PROMPT) {
|
||||
// Notification is shown, check label and deny to clean
|
||||
let popuphidden = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popuphidden"
|
||||
);
|
||||
if (aExpect == PromptResult.PROMPT) {
|
||||
// Notification is shown, check label and deny to clean
|
||||
let popuphidden = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popuphidden"
|
||||
);
|
||||
|
||||
let notification = PopupNotifications.panel.firstElementChild;
|
||||
// Check the label of the notificaiton should be the first party
|
||||
is(
|
||||
PopupNotifications.getNotification("geolocation").options.name,
|
||||
uri.host,
|
||||
"Use first party's origin"
|
||||
);
|
||||
let notification = PopupNotifications.panel.firstElementChild;
|
||||
// Check the label of the notificaiton should be the first party
|
||||
is(
|
||||
PopupNotifications.getNotification("geolocation").options.name,
|
||||
uri.host,
|
||||
"Use first party's origin"
|
||||
);
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
|
||||
EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
|
||||
|
||||
await popuphidden;
|
||||
SitePermissions.removeFromPrincipal(null, "geo", browser);
|
||||
await popuphidden;
|
||||
SitePermissions.removeFromPrincipal(null, "geo", browser);
|
||||
}
|
||||
|
||||
PermissionTestUtils.remove(uri, "geo");
|
||||
}
|
||||
|
||||
PermissionTestUtils.remove(uri, "geo");
|
||||
await checkPermission(Perms.PROMPT_ACTION, PromptResult.PROMPT);
|
||||
await checkPermission(Perms.DENY_ACTION, PromptResult.DENY);
|
||||
await checkPermission(Perms.ALLOW_ACTION, PromptResult.ALLOW);
|
||||
}
|
||||
|
||||
await checkPermission(Perms.PROMPT_ACTION, PromptResult.PROMPT);
|
||||
await checkPermission(Perms.DENY_ACTION, PromptResult.DENY);
|
||||
await checkPermission(Perms.ALLOW_ACTION, PromptResult.ALLOW);
|
||||
});
|
||||
);
|
||||
});
|
||||
|
||||
// Test that we do not prompt for maybe unsafe permission delegation if the
|
||||
// origin of the page is the original src origin.
|
||||
add_task(async function testPromptInMaybeUnsafePermissionDelegation() {
|
||||
await BrowserTestUtils.withNewTab(CROSS_SUBFRAME_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
// Persistent allow top level origin
|
||||
PermissionTestUtils.add(uri, "geo", Perms.ALLOW_ACTION);
|
||||
await BrowserTestUtils.withNewTab(
|
||||
CROSS_SUBFRAME_PAGE,
|
||||
async function (browser) {
|
||||
// Persistent allow top level origin
|
||||
PermissionTestUtils.add(uri, "geo", Perms.ALLOW_ACTION);
|
||||
|
||||
await checkGeolocation(browser, "frameAllowsAll", PromptResult.ALLOW);
|
||||
await checkGeolocation(browser, "frameAllowsAll", PromptResult.ALLOW);
|
||||
|
||||
SitePermissions.removeFromPrincipal(null, "geo", browser);
|
||||
PermissionTestUtils.remove(uri, "geo");
|
||||
});
|
||||
SitePermissions.removeFromPrincipal(null, "geo", browser);
|
||||
PermissionTestUtils.remove(uri, "geo");
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test that we should prompt if we are in unsafe permission delegation and
|
||||
// change location to origin which is not explicitly trusted. The prompt popup
|
||||
// should include both first and third party origin.
|
||||
add_task(async function testPromptChangeLocationUnsafePermissionDelegation() {
|
||||
await BrowserTestUtils.withNewTab(CROSS_SUBFRAME_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
// Persistent allow top level origin
|
||||
PermissionTestUtils.add(uri, "geo", Perms.ALLOW_ACTION);
|
||||
await BrowserTestUtils.withNewTab(
|
||||
CROSS_SUBFRAME_PAGE,
|
||||
async function (browser) {
|
||||
// Persistent allow top level origin
|
||||
PermissionTestUtils.add(uri, "geo", Perms.ALLOW_ACTION);
|
||||
|
||||
let iframe = await SpecialPowers.spawn(browser, [], () => {
|
||||
return content.document.getElementById("frameAllowsAll").browsingContext;
|
||||
});
|
||||
let iframe = await SpecialPowers.spawn(browser, [], () => {
|
||||
return content.document.getElementById("frameAllowsAll")
|
||||
.browsingContext;
|
||||
});
|
||||
|
||||
let otherURI =
|
||||
"https://test1.example.com/browser/browser/base/content/test/permissions/permissions.html";
|
||||
let loaded = BrowserTestUtils.browserLoaded(browser, true, otherURI);
|
||||
await SpecialPowers.spawn(iframe, [otherURI], async function (_otherURI) {
|
||||
content.location = _otherURI;
|
||||
});
|
||||
await loaded;
|
||||
let otherURI =
|
||||
"https://test1.example.com/browser/browser/base/content/test/permissions/permissions.html";
|
||||
let loaded = BrowserTestUtils.browserLoaded(browser, true, otherURI);
|
||||
await SpecialPowers.spawn(iframe, [otherURI], async function (_otherURI) {
|
||||
content.location = _otherURI;
|
||||
});
|
||||
await loaded;
|
||||
|
||||
await checkGeolocation(browser, "frameAllowsAll", PromptResult.PROMPT);
|
||||
await checkNotificationBothOrigins(uri.host, "test1.example.com");
|
||||
await checkGeolocation(browser, "frameAllowsAll", PromptResult.PROMPT);
|
||||
await checkNotificationBothOrigins(uri.host, "test1.example.com");
|
||||
|
||||
SitePermissions.removeFromPrincipal(null, "geo", browser);
|
||||
PermissionTestUtils.remove(uri, "geo");
|
||||
});
|
||||
SitePermissions.removeFromPrincipal(null, "geo", browser);
|
||||
PermissionTestUtils.remove(uri, "geo");
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// If we are in unsafe permission delegation and the origin is explicitly
|
||||
|
@ -9,41 +9,43 @@ const PERMISSIONS_PAGE =
|
||||
"permissions.html";
|
||||
|
||||
function assertShown(task) {
|
||||
return BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
let popupshown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
return BrowserTestUtils.withNewTab(
|
||||
PERMISSIONS_PAGE,
|
||||
async function (browser) {
|
||||
let popupshown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
|
||||
await SpecialPowers.spawn(browser, [], task);
|
||||
await SpecialPowers.spawn(browser, [], task);
|
||||
|
||||
await popupshown;
|
||||
await popupshown;
|
||||
|
||||
ok(true, "Notification permission prompt was shown");
|
||||
});
|
||||
ok(true, "Notification permission prompt was shown");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function assertNotShown(task) {
|
||||
return BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
let popupshown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
return BrowserTestUtils.withNewTab(
|
||||
PERMISSIONS_PAGE,
|
||||
async function (browser) {
|
||||
let popupshown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
|
||||
await SpecialPowers.spawn(browser, [], task);
|
||||
await SpecialPowers.spawn(browser, [], task);
|
||||
|
||||
let sawPrompt = await Promise.race([
|
||||
popupshown.then(() => true),
|
||||
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
|
||||
new Promise(c => setTimeout(() => c(false), 1000)),
|
||||
]);
|
||||
let sawPrompt = await Promise.race([
|
||||
popupshown.then(() => true),
|
||||
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
|
||||
new Promise(c => setTimeout(() => c(false), 1000)),
|
||||
]);
|
||||
|
||||
is(sawPrompt, false, "Notification permission prompt was not shown");
|
||||
});
|
||||
is(sawPrompt, false, "Notification permission prompt was not shown");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Tests that notification permissions are automatically denied without user interaction.
|
||||
|
@ -10,46 +10,47 @@ const PERMISSIONS_PAGE =
|
||||
|
||||
function testPostPrompt(task) {
|
||||
let uri = Services.io.newURI(PERMISSIONS_PAGE);
|
||||
return BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
let icon = document.getElementById("web-notifications-notification-icon");
|
||||
ok(
|
||||
!BrowserTestUtils.is_visible(icon),
|
||||
"notifications icon is not visible at first"
|
||||
);
|
||||
return BrowserTestUtils.withNewTab(
|
||||
PERMISSIONS_PAGE,
|
||||
async function (browser) {
|
||||
let icon = document.getElementById("web-notifications-notification-icon");
|
||||
ok(
|
||||
!BrowserTestUtils.is_visible(icon),
|
||||
"notifications icon is not visible at first"
|
||||
);
|
||||
|
||||
await SpecialPowers.spawn(browser, [], task);
|
||||
await SpecialPowers.spawn(browser, [], task);
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() => BrowserTestUtils.is_visible(icon),
|
||||
"notifications icon is visible"
|
||||
);
|
||||
ok(
|
||||
!PopupNotifications.panel.hasAttribute("panelopen"),
|
||||
"only the icon is showing, the panel is not open"
|
||||
);
|
||||
await TestUtils.waitForCondition(
|
||||
() => BrowserTestUtils.is_visible(icon),
|
||||
"notifications icon is visible"
|
||||
);
|
||||
ok(
|
||||
!PopupNotifications.panel.hasAttribute("panelopen"),
|
||||
"only the icon is showing, the panel is not open"
|
||||
);
|
||||
|
||||
let popupshown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
icon.click();
|
||||
await popupshown;
|
||||
let popupshown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
icon.click();
|
||||
await popupshown;
|
||||
|
||||
ok(true, "Notification permission prompt was shown");
|
||||
ok(true, "Notification permission prompt was shown");
|
||||
|
||||
let notification = PopupNotifications.panel.firstElementChild;
|
||||
EventUtils.synthesizeMouseAtCenter(notification.button, {});
|
||||
let notification = PopupNotifications.panel.firstElementChild;
|
||||
EventUtils.synthesizeMouseAtCenter(notification.button, {});
|
||||
|
||||
is(
|
||||
PermissionTestUtils.testPermission(uri, "desktop-notification"),
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||
"User can override the default deny by using the prompt"
|
||||
);
|
||||
is(
|
||||
PermissionTestUtils.testPermission(uri, "desktop-notification"),
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||
"User can override the default deny by using the prompt"
|
||||
);
|
||||
|
||||
PermissionTestUtils.remove(uri, "desktop-notification");
|
||||
});
|
||||
PermissionTestUtils.remove(uri, "desktop-notification");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
add_task(async function testNotificationPermission() {
|
||||
|
@ -15,9 +15,10 @@ const SUBDOMAIN_EMPTY_PAGE =
|
||||
|
||||
add_task(async function testSiteScopedPermissionSubdomainAffectsBaseDomain() {
|
||||
let subdomainOrigin = "https://www.example.com";
|
||||
let subdomainPrincipal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
subdomainOrigin
|
||||
);
|
||||
let subdomainPrincipal =
|
||||
Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
subdomainOrigin
|
||||
);
|
||||
let id = "3rdPartyStorage^https://example.org";
|
||||
|
||||
await BrowserTestUtils.withNewTab(EMPTY_PAGE, async function (browser) {
|
||||
@ -62,44 +63,44 @@ add_task(async function testSiteScopedPermissionSubdomainAffectsBaseDomain() {
|
||||
|
||||
add_task(async function testSiteScopedPermissionBaseDomainAffectsSubdomain() {
|
||||
let origin = "https://example.com";
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
origin
|
||||
);
|
||||
let principal =
|
||||
Services.scriptSecurityManager.createContentPrincipalFromOrigin(origin);
|
||||
let id = "3rdPartyStorage^https://example.org";
|
||||
|
||||
await BrowserTestUtils.withNewTab(SUBDOMAIN_EMPTY_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
Services.perms.addFromPrincipal(principal, id, SitePermissions.ALLOW);
|
||||
await openPermissionPopup();
|
||||
await BrowserTestUtils.withNewTab(
|
||||
SUBDOMAIN_EMPTY_PAGE,
|
||||
async function (browser) {
|
||||
Services.perms.addFromPrincipal(principal, id, SitePermissions.ALLOW);
|
||||
await openPermissionPopup();
|
||||
|
||||
let permissionsList = document.getElementById(
|
||||
"permission-popup-permission-list"
|
||||
);
|
||||
let listEntryCount = permissionsList.querySelectorAll(
|
||||
".permission-popup-permission-item"
|
||||
).length;
|
||||
is(
|
||||
listEntryCount,
|
||||
1,
|
||||
"Permission exists on base domain when set on subdomain"
|
||||
);
|
||||
let permissionsList = document.getElementById(
|
||||
"permission-popup-permission-list"
|
||||
);
|
||||
let listEntryCount = permissionsList.querySelectorAll(
|
||||
".permission-popup-permission-item"
|
||||
).length;
|
||||
is(
|
||||
listEntryCount,
|
||||
1,
|
||||
"Permission exists on base domain when set on subdomain"
|
||||
);
|
||||
|
||||
closePermissionPopup();
|
||||
closePermissionPopup();
|
||||
|
||||
Services.perms.removeFromPrincipal(principal, id);
|
||||
Services.perms.removeFromPrincipal(principal, id);
|
||||
|
||||
await openPermissionPopup();
|
||||
await openPermissionPopup();
|
||||
|
||||
listEntryCount = permissionsList.querySelectorAll(
|
||||
".permission-popup-permission-item-3rdPartyStorage"
|
||||
).length;
|
||||
is(
|
||||
listEntryCount,
|
||||
0,
|
||||
"Permission removed on base domain when removed on subdomain"
|
||||
);
|
||||
listEntryCount = permissionsList.querySelectorAll(
|
||||
".permission-popup-permission-item-3rdPartyStorage"
|
||||
).length;
|
||||
is(
|
||||
listEntryCount,
|
||||
0,
|
||||
"Permission removed on base domain when removed on subdomain"
|
||||
);
|
||||
|
||||
await closePermissionPopup();
|
||||
});
|
||||
await closePermissionPopup();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -13,9 +13,8 @@ const SUBFRAME_PAGE =
|
||||
|
||||
// Test that setting temp permissions triggers a change in the identity block.
|
||||
add_task(async function testTempPermissionChangeEvents() {
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
ORIGIN
|
||||
);
|
||||
let principal =
|
||||
Services.scriptSecurityManager.createContentPrincipalFromOrigin(ORIGIN);
|
||||
let id = "geo";
|
||||
|
||||
await BrowserTestUtils.withNewTab(ORIGIN, function (browser) {
|
||||
|
@ -34,9 +34,8 @@ add_task(async function testTempPermissionRequestAfterExpiry() {
|
||||
],
|
||||
});
|
||||
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||
ORIGIN
|
||||
);
|
||||
let principal =
|
||||
Services.scriptSecurityManager.createContentPrincipalFromOrigin(ORIGIN);
|
||||
let ids = ["geo", "camera"];
|
||||
|
||||
if (kVREnabled) {
|
||||
@ -44,71 +43,72 @@ add_task(async function testTempPermissionRequestAfterExpiry() {
|
||||
}
|
||||
|
||||
for (let id of ids) {
|
||||
await BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function (
|
||||
browser
|
||||
) {
|
||||
let blockedIcon = gPermissionPanel._identityPermissionBox.querySelector(
|
||||
`.blocked-permission-icon[data-permission-id='${id}']`
|
||||
);
|
||||
await BrowserTestUtils.withNewTab(
|
||||
PERMISSIONS_PAGE,
|
||||
async function (browser) {
|
||||
let blockedIcon = gPermissionPanel._identityPermissionBox.querySelector(
|
||||
`.blocked-permission-icon[data-permission-id='${id}']`
|
||||
);
|
||||
|
||||
SitePermissions.setForPrincipal(
|
||||
principal,
|
||||
id,
|
||||
SitePermissions.BLOCK,
|
||||
SitePermissions.SCOPE_TEMPORARY,
|
||||
browser
|
||||
);
|
||||
SitePermissions.setForPrincipal(
|
||||
principal,
|
||||
id,
|
||||
SitePermissions.BLOCK,
|
||||
SitePermissions.SCOPE_TEMPORARY,
|
||||
browser
|
||||
);
|
||||
|
||||
Assert.deepEqual(
|
||||
SitePermissions.getForPrincipal(principal, id, browser),
|
||||
{
|
||||
state: SitePermissions.BLOCK,
|
||||
scope: SitePermissions.SCOPE_TEMPORARY,
|
||||
}
|
||||
);
|
||||
Assert.deepEqual(
|
||||
SitePermissions.getForPrincipal(principal, id, browser),
|
||||
{
|
||||
state: SitePermissions.BLOCK,
|
||||
scope: SitePermissions.SCOPE_TEMPORARY,
|
||||
}
|
||||
);
|
||||
|
||||
ok(
|
||||
blockedIcon.hasAttribute("showing"),
|
||||
"blocked permission icon is shown"
|
||||
);
|
||||
ok(
|
||||
blockedIcon.hasAttribute("showing"),
|
||||
"blocked permission icon is shown"
|
||||
);
|
||||
|
||||
await new Promise(c => setTimeout(c, TIMEOUT_MS));
|
||||
await new Promise(c => setTimeout(c, TIMEOUT_MS));
|
||||
|
||||
Assert.deepEqual(
|
||||
SitePermissions.getForPrincipal(principal, id, browser),
|
||||
{
|
||||
state: SitePermissions.UNKNOWN,
|
||||
scope: SitePermissions.SCOPE_PERSISTENT,
|
||||
}
|
||||
);
|
||||
Assert.deepEqual(
|
||||
SitePermissions.getForPrincipal(principal, id, browser),
|
||||
{
|
||||
state: SitePermissions.UNKNOWN,
|
||||
scope: SitePermissions.SCOPE_PERSISTENT,
|
||||
}
|
||||
);
|
||||
|
||||
let popupshown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
let popupshown = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popupshown"
|
||||
);
|
||||
|
||||
// Request a permission;
|
||||
await BrowserTestUtils.synthesizeMouseAtCenter(`#${id}`, {}, browser);
|
||||
// Request a permission;
|
||||
await BrowserTestUtils.synthesizeMouseAtCenter(`#${id}`, {}, browser);
|
||||
|
||||
await popupshown;
|
||||
await popupshown;
|
||||
|
||||
ok(
|
||||
!blockedIcon.hasAttribute("showing"),
|
||||
"blocked permission icon is not shown"
|
||||
);
|
||||
ok(
|
||||
!blockedIcon.hasAttribute("showing"),
|
||||
"blocked permission icon is not shown"
|
||||
);
|
||||
|
||||
let popuphidden = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popuphidden"
|
||||
);
|
||||
let popuphidden = BrowserTestUtils.waitForEvent(
|
||||
PopupNotifications.panel,
|
||||
"popuphidden"
|
||||
);
|
||||
|
||||
let notification = PopupNotifications.panel.firstElementChild;
|
||||
EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
|
||||
let notification = PopupNotifications.panel.firstElementChild;
|
||||
EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
|
||||
|
||||
await popuphidden;
|
||||
await popuphidden;
|
||||
|
||||
SitePermissions.removeFromPrincipal(principal, id, browser);
|
||||
});
|
||||
SitePermissions.removeFromPrincipal(principal, id, browser);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@ -122,9 +122,8 @@ async function testIdentityPermissionGrantedState(state) {
|
||||
state ? "shows" : "does not show"
|
||||
} granted permissions.`;
|
||||
await TestUtils.waitForCondition(() => {
|
||||
hasAttribute = gPermissionPanel._identityPermissionBox.hasAttribute(
|
||||
"hasPermissions"
|
||||
);
|
||||
hasAttribute =
|
||||
gPermissionPanel._identityPermissionBox.hasAttribute("hasPermissions");
|
||||
return hasAttribute == state;
|
||||
}, msg);
|
||||
is(hasAttribute, state, msg);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user