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

Unified Diff: background.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: Use method shorthand Created Jan. 16, 2017, 4:07 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
« no previous file with comments | « no previous file | chrome/devtools.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
diff --git a/background.js b/background.js
index cfc9536c00e1c2d3a57673cbaecff059253279fc..1381ebc9fe6e7eed5e8533474115b9303880e9c9 100644
--- a/background.js
+++ b/background.js
@@ -15,23 +15,25 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-var RegExpFilter = require("filterClasses").RegExpFilter;
-var ElemHide = require("elemHide").ElemHide;
-var checkWhitelisted = require("whitelisting").checkWhitelisted;
-var extractHostFromFrame = require("url").extractHostFromFrame;
-var port = require("messaging").port;
-var devtools = require("devtools");
+"use strict";
-port.on("get-selectors", function(msg, sender)
+let RegExpFilter = require("filterClasses").RegExpFilter;
+let ElemHide = require("elemHide").ElemHide;
+let checkWhitelisted = require("whitelisting").checkWhitelisted;
+let extractHostFromFrame = require("url").extractHostFromFrame;
+let port = require("messaging").port;
+let devtools = require("devtools");
+
+port.on("get-selectors", (msg, sender) =>
{
- var selectors;
- var trace = devtools && devtools.hasPanel(sender.page);
+ let selectors;
+ let trace = devtools && devtools.hasPanel(sender.page);
if (!checkWhitelisted(sender.page, sender.frame,
RegExpFilter.typeMap.DOCUMENT |
RegExpFilter.typeMap.ELEMHIDE))
{
- var specificOnly = checkWhitelisted(sender.page, sender.frame,
+ let specificOnly = checkWhitelisted(sender.page, sender.frame,
RegExpFilter.typeMap.GENERICHIDE);
selectors = ElemHide.getSelectorsForDomain(
extractHostFromFrame(sender.frame),
@@ -46,9 +48,9 @@ port.on("get-selectors", function(msg, sender)
return {selectors: selectors, trace: trace};
});
-port.on("forward", function(msg, sender)
+port.on("forward", (msg, sender) =>
{
- var targetPage;
+ let targetPage;
if (msg.targetPageId)
targetPage = ext.getPage(msg.targetPageId);
else
« no previous file with comments | « no previous file | chrome/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld