Bug 1521765 - Use web technologies for "about:config" in the browser application. r=Mossop

Differential Revision: https://phabricator.services.mozilla.com/D17419

--HG--
extra : rebase_source : a4b41649be6f61853a2ce494626184ee7e3a5c77
This commit is contained in:
Paolo Amadini 2019-01-24 13:05:08 +00:00
parent 2b8c933ad7
commit 70d2131682
10 changed files with 25 additions and 8 deletions

View File

@ -13,7 +13,7 @@ add_task(async function findBarDisabledOnSomePages() {
ok(!gFindBar.hidden, "Find bar should be visible");
let urls = [
"about:config",
"about:preferences",
"about:addons",
];

View File

@ -42,8 +42,10 @@ var gExceptionPaths = [
// Exclude all search-plugins because they aren't referenced by filename
"resource://search-plugins/",
// This is only in Nightly, and accessed using a direct chrome URL
"chrome://browser/content/aboutconfig/",
// Previous version of "about:config" kept for risk mitigation as a hidden
// page accessed using a direct chrome URL, will be removed in the future.
"chrome://global/content/config.js",
"chrome://global/content/config.xul",
];
// These are not part of the omni.ja file, so we find them only when running

View File

@ -53,6 +53,7 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
{"config", "chrome://browser/content/aboutconfig/aboutconfig.html", 0},
{"tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},

View File

@ -93,6 +93,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
#endif
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "blocked", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "certerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "config", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "tabcrashed", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },

View File

@ -143,6 +143,7 @@ skip-if = true
[browser_354894_perwindowpb.js]
[browser_367052.js]
[browser_393716.js]
skip-if = debug # Bug 1507747
[browser_394759_basic.js]
# Disabled for intermittent failures, bug 944372.
skip-if = true

View File

@ -5,6 +5,15 @@
const URL = "about:config";
add_task(async function setup() {
// Make sure that the field of which we restore the state is visible on load.
await SpecialPowers.pushPrefEnv({
set: [
["browser.aboutConfig.showWarning", false],
],
});
});
/**
* Bug 393716 - Basic tests for getTabState(), setTabState(), and duplicateTab().
*/
@ -52,7 +61,7 @@ add_task(async function test_set_tabstate_and_duplicate() {
"the tab's state was correctly restored");
// add text data
await setInputValue(tab.linkedBrowser, {id: "textbox", value: value3});
await setInputValue(tab.linkedBrowser, {id: "search", value: value3});
// duplicate the tab
let tab2 = ss.duplicateTab(window, tab);
@ -62,7 +71,7 @@ add_task(async function test_set_tabstate_and_duplicate() {
ok(ss.getCustomTabValue(tab2, key2) == value2 &&
tab2.linkedBrowser.currentURI.spec == URL,
"correctly duplicated the tab's state");
let textbox = await getInputValue(tab2.linkedBrowser, {id: "textbox"});
let textbox = await getInputValue(tab2.linkedBrowser, {id: "search"});
is(textbox, value3, "also duplicated text data");
// clean up

View File

@ -72,7 +72,9 @@ static const RedirEntry kRedirMap[] = {
{"checkerboard", "chrome://global/content/aboutCheckerboard.xhtml",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT},
#if !defined(NIGHTLY_BUILD) || !defined(MOZ_BUILD_APP_IS_BROWSER)
{"config", "chrome://global/content/config.xul", 0},
#endif
#ifdef MOZ_CRASHREPORTER
{"crashes", "chrome://global/content/crashes.xhtml", 0},
#endif

View File

@ -148,7 +148,9 @@ const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "addons", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "buildconfig", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "checkerboard", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#if !defined(NIGHTLY_BUILD) || !defined(MOZ_BUILD_APP_IS_BROWSER)
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "config", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#endif
#ifdef MOZ_CRASHREPORTER
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "crashes", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#endif

View File

@ -3,12 +3,12 @@ add_task(async function() {
let newTabURL = "http://www.example.com/";
await ContentTask.spawn(browser, newTabURL, async function(newTabURL) {
let doc = content.document;
let label = doc.createElement("label");
let label = doc.createXULElement("label");
label.href = newTabURL;
label.id = "textlink-test";
label.className = "text-link";
label.textContent = "click me";
doc.documentElement.append(label);
doc.body.prepend(label);
});
// Test that click will open tab in foreground.

View File

@ -319,7 +319,6 @@ var BrowserUtils = {
*/
canFindInPage(location) {
return !location.startsWith("about:addons") &&
!location.startsWith("about:config") &&
!location.startsWith("about:preferences");
},