Bug 1432645 add browserSetting to flip urlbar.openintab, r=rpl
authorShane Caraveo <scaraveo@mozilla.com>
Wed, 18 Apr 2018 14:24:32 -0500
changeset 468033 154e987909aabcb08fa0c20a0446a83ea802825d
parent 468032 7b01ccfbcc6e11c3fc8c7a469e80741cd711a277
child 468034 d419e0c3d798d8df9bb07640e28546109cde4fe5
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl
bugs1432645
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1432645 add browserSetting to flip urlbar.openintab, r=rpl MozReview-Commit-ID: 6egB1yj6bkI
toolkit/components/extensions/parent/ext-browserSettings.js
toolkit/components/extensions/schemas/browser_settings.json
toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
--- a/toolkit/components/extensions/parent/ext-browserSettings.js
+++ b/toolkit/components/extensions/parent/ext-browserSettings.js
@@ -164,16 +164,26 @@ ExtensionPreferencesManager.addSetting("
     "browser.search.openintab",
   ],
 
   setCallback(value) {
     return {[this.prefNames[0]]: value};
   },
 });
 
+ExtensionPreferencesManager.addSetting("openUrlbarResultsInNewTabs", {
+  prefNames: [
+    "browser.urlbar.openintab",
+  ],
+
+  setCallback(value) {
+    return {[this.prefNames[0]]: value};
+  },
+});
+
 ExtensionPreferencesManager.addSetting("proxyConfig", {
   prefNames: [
     "network.proxy.type",
     "network.proxy.http",
     "network.proxy.http_port",
     "network.proxy.share_proxy_settings",
     "network.proxy.ftp",
     "network.proxy.ftp_port",
@@ -330,16 +340,21 @@ this.browserSettings = class extends Ext
           () => {
             return Services.prefs.getBoolPref("browser.tabs.loadBookmarksInTabs");
           }),
         openSearchResultsInNewTabs: getSettingsAPI(
           extension, "openSearchResultsInNewTabs",
           () => {
             return Services.prefs.getBoolPref("browser.search.openintab");
           }),
+        openUrlbarResultsInNewTabs: getSettingsAPI(
+          extension, "openUrlbarResultsInNewTabs",
+          () => {
+            return Services.prefs.getBoolPref("browser.urlbar.openintab");
+          }),
         proxyConfig: Object.assign(
           getSettingsAPI(
             extension, "proxyConfig",
             () => {
               let prefValue = Services.prefs.getIntPref("network.proxy.type");
               let proxyConfig = {
                 proxyType:
                   Array.from(
--- a/toolkit/components/extensions/schemas/browser_settings.json
+++ b/toolkit/components/extensions/schemas/browser_settings.json
@@ -144,16 +144,20 @@
       "openBookmarksInNewTabs": {
         "$ref": "types.Setting",
         "description": "This boolean setting controls whether bookmarks are opened in the current tab or in a new tab."
       },
       "openSearchResultsInNewTabs": {
         "$ref": "types.Setting",
         "description": "This boolean setting controls whether search results are opened in the current tab or in a new tab."
       },
+      "openUrlbarResultsInNewTabs": {
+        "$ref": "types.Setting",
+        "description": "This boolean setting controls whether urlbar results are opened in the current tab or in a new tab."
+      },
       "proxyConfig": {
         "$ref": "types.Setting",
         "description": "Configures proxy settings. This setting's value is an object of type ProxyConfig."
       },
       "webNotificationsDisabled": {
         "$ref": "types.Setting",
         "description": "Disables webAPI notifications."
       },
--- a/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
@@ -207,16 +207,23 @@ add_task(async function test_browser_set
   await testSetting(
     "openSearchResultsInNewTabs", true,
     {"browser.search.openintab": true});
   await testSetting(
     "openSearchResultsInNewTabs", false,
     {"browser.search.openintab": false});
 
   await testSetting(
+    "openUrlbarResultsInNewTabs", true,
+    {"browser.urlbar.openintab": true});
+  await testSetting(
+    "openUrlbarResultsInNewTabs", false,
+    {"browser.urlbar.openintab": false});
+
+  await testSetting(
     "overrideDocumentColors", "high-contrast-only",
     {"browser.display.document_color_use": 0});
   await testSetting(
     "overrideDocumentColors", "never",
     {"browser.display.document_color_use": 1});
   await testSetting(
     "overrideDocumentColors", "always",
     {"browser.display.document_color_use": 2});