diff --git a/chromium/pages/cancel/index.html b/chromium/pages/cancel/index.html index 76aeb3985f8a..8357ab462132 100644 --- a/chromium/pages/cancel/index.html +++ b/chromium/pages/cancel/index.html @@ -12,7 +12,7 @@

HTTPS Ever
     <p data-i18n=

URL:

- + diff --git a/chromium/pages/debugging-rulesets/index.html b/chromium/pages/debugging-rulesets/index.html index bd6f74332d1a..d3e91227f4c3 100644 --- a/chromium/pages/debugging-rulesets/index.html +++ b/chromium/pages/debugging-rulesets/index.html @@ -19,7 +19,7 @@
Saved!
- + diff --git a/chromium/pages/devtools/index.html b/chromium/pages/devtools/index.html index 02711dc76d20..940de8bf0fd4 100644 --- a/chromium/pages/devtools/index.html +++ b/chromium/pages/devtools/index.html @@ -3,7 +3,7 @@ - + diff --git a/chromium/pages/options/index.html b/chromium/pages/options/index.html index 2364ffcab7a5..aee189319074 100644 --- a/chromium/pages/options/index.html +++ b/chromium/pages/options/index.html @@ -52,7 +52,6 @@ - diff --git a/chromium/pages/popup/index.html b/chromium/pages/popup/index.html index 62f34394d3f5..8097c5bdd244 100644 --- a/chromium/pages/popup/index.html +++ b/chromium/pages/popup/index.html @@ -7,7 +7,7 @@ - +
diff --git a/chromium/pages/popup/ux.js b/chromium/pages/popup/ux.js index 107f2590db29..2c4ab9392b72 100644 --- a/chromium/pages/popup/ux.js +++ b/chromium/pages/popup/ux.js @@ -1,11 +1,12 @@ +/* global e */ +/* global hide */ +/* global show */ /* global sendMessage */ +/* global getOption_ */ +/* global setOption_ */ "use strict"; -function e(id) { - return document.getElementById(id); -} - /** * Handles rule (de)activation in the popup */ @@ -209,14 +210,6 @@ var escapeForRegex = function( value ) { return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); }; -function hide(elem) { - elem.style.display = "none"; -} - -function show(elem) { - elem.style.display = "block"; -} - function showEnableOrDisable(url, disabled) { if (["http:", "https:", "ftp:"].indexOf(url.protocol) != -1) { const disableLink = e("disable-on-this-site"); @@ -311,18 +304,6 @@ function toggleHttpNowhere() { }); } -function getOption_(opt, defaultOpt, callback) { - var details = {}; - details[opt] = defaultOpt; - sendMessage("get_option", details, callback); -} - -function setOption_(opt, value, callback) { - var details = {}; - details[opt] = value; - sendMessage("set_option", details, callback); -} - function getTab(callback) { let url = new URL(window.location.href); if (url.searchParams.has('tabId')) { diff --git a/chromium/pages/send-message.js b/chromium/pages/send-message.js deleted file mode 100644 index da8adf5763c0..000000000000 --- a/chromium/pages/send-message.js +++ /dev/null @@ -1,7 +0,0 @@ -/* exported sendMessage */ - -"use strict"; - -function sendMessage(type, object, callback) { - chrome.runtime.sendMessage({ type, object }, callback); -} diff --git a/chromium/pages/util.js b/chromium/pages/util.js index bf8e2cbbeaf9..4e5aea4f9acd 100644 --- a/chromium/pages/util.js +++ b/chromium/pages/util.js @@ -1,7 +1,9 @@ /* exported e */ /* exported hide */ /* exported show */ +/* exported sendMessage */ /* exported getOption_ */ +/* exported setOption_ */ "use strict"; @@ -20,6 +22,10 @@ function show(elem) { elem.style.display = "block"; } +function sendMessage(type, object, callback) { + chrome.runtime.sendMessage({ type, object }, callback); +} + /** * Get an option from global settings * @param {string} opt @@ -32,3 +38,9 @@ function getOption_(opt, defaultOpt, callback) { details[opt] = defaultOpt; sendMessage("get_option", details, callback); } + +function setOption_(opt, value, callback) { + var details = {}; + details[opt] = value; + sendMessage("set_option", details, callback); +}