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

Side by Side Diff: lib/csp.js

Issue 29737602: Issue 4580 - Make filter/request logging use plain tabIds, prepare for multi-tab requests (Closed)
Patch Set: Removed outdated comment Created April 4, 2018, 1:48 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/cssInjection.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // and if necessary that our $csp filter is specific. 51 // and if necessary that our $csp filter is specific.
52 let specificOnly = !!checkWhitelisted(page, frame, typeMap.GENERICBLOCK); 52 let specificOnly = !!checkWhitelisted(page, frame, typeMap.GENERICBLOCK);
53 if (specificOnly) 53 if (specificOnly)
54 { 54 {
55 cspMatch = defaultMatcher.matchesAny(urlString, typeMap.CSP, hostname, 55 cspMatch = defaultMatcher.matchesAny(urlString, typeMap.CSP, hostname,
56 thirdParty, null, specificOnly); 56 thirdParty, null, specificOnly);
57 if (!cspMatch) 57 if (!cspMatch)
58 return; 58 return;
59 } 59 }
60 60
61 devtools.logRequest(page, urlString, "CSP", hostname, thirdParty, null, 61 devtools.logRequest([details.tabId], urlString, "CSP", hostname,
62 specificOnly, cspMatch); 62 thirdParty, null, specificOnly, cspMatch);
63 FilterNotifier.emit("filter.hitCount", cspMatch, 0, 0, page); 63 FilterNotifier.emit("filter.hitCount", cspMatch, 0, 0, [details.tabId]);
64 64
65 if (cspMatch instanceof WhitelistFilter) 65 if (cspMatch instanceof WhitelistFilter)
66 return; 66 return;
67 67
68 details.responseHeaders.push({ 68 details.responseHeaders.push({
69 name: "Content-Security-Policy", 69 name: "Content-Security-Policy",
70 value: cspMatch.csp 70 value: cspMatch.csp
71 }); 71 });
72 72
73 return {responseHeaders: details.responseHeaders}; 73 return {responseHeaders: details.responseHeaders};
74 } 74 }
75 }, { 75 }, {
76 urls: ["http://*/*", "https://*/*"], 76 urls: ["http://*/*", "https://*/*"],
77 types: ["main_frame", "sub_frame"] 77 types: ["main_frame", "sub_frame"]
78 }, ["blocking", "responseHeaders"]); 78 }, ["blocking", "responseHeaders"]);
OLDNEW
« no previous file with comments | « no previous file | lib/cssInjection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld