Skip to content

Commit b98ef81

Browse files
committed
Fix CSP injection in non-document resources
Related feedback: uBlockOrigin/uBlock-issues#229 (comment) https://old.reddit.com/r/uBlockOrigin/comments/1dz6du7/ Regression from: 7c3e060c01
1 parent e3b71a5 commit b98ef81

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/js/traffic.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,10 @@ const bodyFilterer = (( ) => {
945945
/******************************************************************************/
946946

947947
const injectCSP = function(fctxt, pageStore, responseHeaders) {
948+
// https://github.com/uBlockOrigin/uBlock-issues/issues/229#issuecomment-2220354261
949+
// Inject CSP in document resource only
950+
if ( fctxt.isDocument() === false ) { return; }
951+
948952
const cspSubsets = [];
949953
const requestType = fctxt.type;
950954

0 commit comments

Comments
 (0)