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

Delta Between Two Patch Sets: lib/csp.js

Issue 29998582: Issue [TBD] - Update adblockpluscore dependency to [TBD] Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Remove matchRequest Created Feb. 5, 2019, 5:15 a.m.
Right Patch Set: Reformat Created Feb. 5, 2019, 5:45 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/devtools.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 { 61 {
62 logRequest( 62 logRequest(
63 [details.tabId], 63 [details.tabId],
64 {url: details.url, type: "CSP", docDomain: hostname, specificOnly}, 64 {url: details.url, type: "CSP", docDomain: hostname, specificOnly},
65 cspMatch 65 cspMatch
66 ); 66 );
67 filterNotifier.emit("filter.hitCount", cspMatch, 0, 0, [details.tabId]); 67 filterNotifier.emit("filter.hitCount", cspMatch, 0, 0, [details.tabId]);
68 return; 68 return;
69 } 69 }
70 70
71 let {blocking} = defaultMatcher.search(url, typeMap.CSP, hostname, 71 let {blocking} = defaultMatcher.search(url, typeMap.CSP, hostname, null,
72 null, specificOnly, 72 specificOnly, "blocking");
73 "blocking");
74 for (cspMatch of blocking) 73 for (cspMatch of blocking)
75 { 74 {
76 logRequest( 75 logRequest(
77 [details.tabId], 76 [details.tabId],
78 {url: details.url, type: "CSP", docDomain: hostname, specificOnly}, 77 {url: details.url, type: "CSP", docDomain: hostname, specificOnly},
79 cspMatch 78 cspMatch
80 ); 79 );
81 filterNotifier.emit("filter.hitCount", cspMatch, 0, 0, [details.tabId]); 80 filterNotifier.emit("filter.hitCount", cspMatch, 0, 0, [details.tabId]);
82 81
83 details.responseHeaders.push({ 82 details.responseHeaders.push({
84 name: "Content-Security-Policy", 83 name: "Content-Security-Policy",
85 value: cspMatch.csp 84 value: cspMatch.csp
86 }); 85 });
87 } 86 }
88 87
89 return {responseHeaders: details.responseHeaders}; 88 return {responseHeaders: details.responseHeaders};
90 } 89 }
91 }, { 90 }, {
92 urls: ["http://*/*", "https://*/*"], 91 urls: ["http://*/*", "https://*/*"],
93 types: ["main_frame", "sub_frame"] 92 types: ["main_frame", "sub_frame"]
94 }, ["blocking", "responseHeaders"]); 93 }, ["blocking", "responseHeaders"]);
LEFTRIGHT
« no previous file | lib/devtools.js » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld