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: Further simplify addSelectors Created June 2, 2017, 3:39 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
===================================================================
--- a/background.js
+++ b/background.js
@@ -12,46 +12,17 @@
* 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/>.
*/
"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) =>
{
let targetPage;
if (msg.targetPageId)
targetPage = ext.getPage(msg.targetPageId);
else
targetPage = sender.page;
« no previous file with comments | « no previous file | ext/background.js » ('j') | include.preload.js » ('J')

Powered by Google App Engine
This is Rietveld