зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1458764 - Removed the references with extensions.webextensions.tabhide.enabled pref. r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D97092
This commit is contained in:
Родитель
bd20dc3fed
Коммит
970cc13ce5
|
@ -50,8 +50,6 @@ XPCOMUtils.defineLazyGetter(this, "strBundle", function() {
|
|||
|
||||
var { DefaultMap, ExtensionError } = ExtensionUtils;
|
||||
|
||||
const TABHIDE_PREFNAME = "extensions.webextensions.tabhide.enabled";
|
||||
|
||||
const TAB_HIDE_CONFIRMED_TYPE = "tabHideNotification";
|
||||
|
||||
const TAB_ID_NONE = -1;
|
||||
|
@ -1536,12 +1534,6 @@ this.tabs = class extends ExtensionAPI {
|
|||
},
|
||||
|
||||
show(tabIds) {
|
||||
if (!Services.prefs.getBoolPref(TABHIDE_PREFNAME, false)) {
|
||||
throw new ExtensionError(
|
||||
`tabs.show is currently experimental and must be enabled with the ${TABHIDE_PREFNAME} preference.`
|
||||
);
|
||||
}
|
||||
|
||||
for (let tab of getNativeTabsFromIDArray(tabIds)) {
|
||||
if (tab.ownerGlobal) {
|
||||
tab.ownerGlobal.gBrowser.showTab(tab);
|
||||
|
@ -1550,12 +1542,6 @@ this.tabs = class extends ExtensionAPI {
|
|||
},
|
||||
|
||||
hide(tabIds) {
|
||||
if (!Services.prefs.getBoolPref(TABHIDE_PREFNAME, false)) {
|
||||
throw new ExtensionError(
|
||||
`tabs.hide is currently experimental and must be enabled with the ${TABHIDE_PREFNAME} preference.`
|
||||
);
|
||||
}
|
||||
|
||||
let hidden = [];
|
||||
for (let tab of getNativeTabsFromIDArray(tabIds)) {
|
||||
if (tab.ownerGlobal && !tab.hidden) {
|
||||
|
|
|
@ -21,10 +21,6 @@ const { E10SUtils } = ChromeUtils.import(
|
|||
const triggeringPrincipal_base64 = E10SUtils.SERIALIZED_SYSTEMPRINCIPAL;
|
||||
|
||||
async function doorhangerTest(testFn) {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.tabhide.enabled", true]],
|
||||
});
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
permissions: ["tabs", "tabHide"],
|
||||
|
@ -385,39 +381,3 @@ add_task(async function test_tabs_shutdown() {
|
|||
BrowserTestUtils.removeTab(tabs[0]);
|
||||
BrowserTestUtils.removeTab(tabs[1]);
|
||||
});
|
||||
|
||||
// Ensure the pref prevents API use when the extension has the tabHide permission.
|
||||
add_task(async function test_pref_disabled() {
|
||||
// This should run last since SpecialPowers.pushPrefEnv won't cleanup until
|
||||
// this file finishes executing.
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.tabhide.enabled", false]],
|
||||
});
|
||||
|
||||
async function background() {
|
||||
let tabs = await browser.tabs.query({ hidden: false });
|
||||
let ids = tabs.map(tab => tab.id);
|
||||
|
||||
await browser.test
|
||||
.assertRejects(
|
||||
browser.tabs.hide(ids),
|
||||
/tabs.hide is currently experimental/,
|
||||
"Got the expected error when pref not enabled"
|
||||
)
|
||||
.catch(err => {
|
||||
browser.test.notifyFail("pref-test");
|
||||
throw err;
|
||||
});
|
||||
|
||||
browser.test.notifyPass("pref-test");
|
||||
}
|
||||
|
||||
let extdata = {
|
||||
manifest: { permissions: ["tabs", "tabHide"] },
|
||||
background,
|
||||
};
|
||||
let extension = ExtensionTestUtils.loadExtension(extdata);
|
||||
await extension.startup();
|
||||
await extension.awaitFinish("pref-test");
|
||||
await extension.unload();
|
||||
});
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function test_tabs_mediaIndicators() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.tabhide.enabled", true]],
|
||||
});
|
||||
|
||||
let initialTab = gBrowser.selectedTab;
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(
|
||||
gBrowser,
|
||||
|
|
|
@ -3885,9 +3885,6 @@ pref("extensions.webextensions.restrictedDomains", "accounts-static.cdn.mozilla.
|
|||
// unless other process sandboxing and extension remoting prefs are changed.
|
||||
pref("extensions.webextensions.protocol.remote", true);
|
||||
|
||||
// Enable tab hiding API by default.
|
||||
pref("extensions.webextensions.tabhide.enabled", true);
|
||||
|
||||
// Enable userScripts API by default.
|
||||
pref("extensions.webextensions.userScripts.enabled", true);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче