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

Unified Diff: lib/csp.js

Issue 29713631: Issue 5760 - Use relative require paths (Closed)
Patch Set: Address PS3 comment Created April 3, 2018, 6:03 p.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/csp.js
===================================================================
--- a/lib/csp.js
+++ b/lib/csp.js
@@ -19,20 +19,21 @@
// The webRequest API doesn't support WebSocket connection blocking in Microsoft
kzar 2018/04/05 11:14:56 Looks like this needs rebasing (on top of the next
Jon Sonesen 2018/04/05 23:01:20 Acknowledged.
// Edge and versions of Chrome before 58. Therefore for those we inject CSP
// headers below as a workaround. See https://crbug.com/129353 and
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10297376/
if (!browser.webRequest.ResourceType ||
!("WEBSOCKET" in browser.webRequest.ResourceType))
{
- const {defaultMatcher} = require("matcher");
- const {BlockingFilter, RegExpFilter} = require("filterClasses");
- const {getDecodedHostname} = require("url");
- const {checkWhitelisted} = require("whitelisting");
+ const {defaultMatcher} = require("../adblockpluscore/lib/matcher");
+ const {BlockingFilter, RegExpFilter} =
+ require("../adblockpluscore/lib/filterClasses");
+ const {getDecodedHostname} = require("./url");
+ const {checkWhitelisted} = require("./whitelisting");
browser.webRequest.onHeadersReceived.addListener(details =>
{
let hostname = getDecodedHostname(new URL(details.url));
let match = defaultMatcher.matchesAny("", RegExpFilter.typeMap.WEBSOCKET,
hostname, false, null, true);
if (match instanceof BlockingFilter &&
!checkWhitelisted(new ext.Page({id: details.tabId}),
« no previous file with comments | « include.preload.js ('k') | lib/cssInjection.js » ('j') | lib/filterComposer.js » ('J')

Powered by Google App Engine
This is Rietveld