Index: lib/options.js |
=================================================================== |
--- a/lib/options.js |
+++ b/lib/options.js |
@@ -12,22 +12,20 @@ |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
/** @module options */ |
-"use strict"; |
- |
-const {getDecodedHostname} = require("url"); |
-const {checkWhitelisted} = require("whitelisting"); |
-const {port} = require("messaging"); |
-const info = require("info"); |
+import {getDecodedHostname} from "url"; |
+import {checkWhitelisted} from "whitelisting"; |
+import {port} from "messaging"; |
+import info from "info"; |
const optionsUrl = "options.html"; |
function findOptionsTab(callback) |
{ |
browser.tabs.query({}, tabs => |
{ |
// We find a tab ourselves because Edge has a bug when quering tabs with |
@@ -117,23 +115,22 @@ |
} |
} |
port.on("app.listen", onMessage); |
}); |
} |
} |
-let showOptions = |
/** |
* Opens the options page. |
* |
* @param {function} callback |
*/ |
-exports.showOptions = callback => |
+export const showOptions = callback => |
{ |
findOptionsTab(optionsTab => |
{ |
// Edge does not yet support runtime.openOptionsPage (tested version 38) |
if ("openOptionsPage" in browser.runtime && |
// Some versions of Firefox for Android before version 57 do have a |
// runtime.openOptionsPage but it doesn't do anything. |
// https://bugzilla.mozilla.org/show_bug.cgi?id=1364945 |