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

Unified Diff: background.js

Issue 29410607: Issue 5090 - Use user stylesheets for element hiding if possible (Closed)
Patch Set: Use feature detection Created May 18, 2017, 2:21 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 | ext/background.js » ('j') | include.preload.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
diff --git a/background.js b/background.js
index cb7a861be117f6a390b74ffa1370bb9de50ba33f..50d7e3bb47a93afc3773355a02b0a54c6629f789 100644
--- a/background.js
+++ b/background.js
@@ -17,36 +17,7 @@
"use strict";
-const {RegExpFilter} = require("filterClasses");
-const {ElemHide} = require("elemHide");
-const {checkWhitelisted} = require("whitelisting");
-const {extractHostFromFrame} = require("url");
const {port} = require("messaging");
-const devtools = require("devtools");
-
-port.on("get-selectors", (msg, sender) =>
-{
- let selectors;
- let trace = devtools && devtools.hasPanel(sender.page);
-
- if (!checkWhitelisted(sender.page, sender.frame,
- RegExpFilter.typeMap.DOCUMENT |
- RegExpFilter.typeMap.ELEMHIDE))
- {
- let specificOnly = checkWhitelisted(sender.page, sender.frame,
- RegExpFilter.typeMap.GENERICHIDE);
- selectors = ElemHide.getSelectorsForDomain(
- extractHostFromFrame(sender.frame),
- specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.ALL_MATCHING
- );
- }
- else
- {
- selectors = [];
- }
-
- return {selectors, trace};
-});
port.on("forward", (msg, sender) =>
{
« no previous file with comments | « no previous file | ext/background.js » ('j') | include.preload.js » ('J')

Powered by Google App Engine
This is Rietveld