Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/options.js

Issue 29715577: Issue 6449 - Switch to Harmony modules (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Add lib/.eslintrc.json Created March 6, 2018, 10:30 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« lib/.eslintrc.json ('K') | « lib/notificationHelper.js ('k') | lib/popupBlocker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld