From 89f02098fd5b3564077c8e95ed9e5c95ff10f4d3 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 4 Sep 2024 11:28:45 -0400 Subject: [PATCH] Apply CSP/PP injections to `object` resources Related feedback: https://old.reddit.com/r/uBlockOrigin/comments/1f84tc5/ --- src/js/background.js | 2 +- src/js/filtering-context.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index edeac0893..4cd10eeff 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -346,7 +346,7 @@ const µBlock = { // jshint ignore:line this.setDocOrigin(origin).setTabOrigin(origin); return this; } - const origin = (this.itype & this.FRAME_ANY) !== 0 + const origin = this.isDocument() ? originFromURI(this.url) : this.tabOrigin; this.setDocOrigin(origin).setTabOrigin(origin); diff --git a/src/js/filtering-context.js b/src/js/filtering-context.js index 664205071..3da9d158f 100644 --- a/src/js/filtering-context.js +++ b/src/js/filtering-context.js @@ -56,7 +56,7 @@ export const XMLHTTPREQUEST = 1 << 13; export const INLINE_FONT = 1 << 14; export const INLINE_SCRIPT = 1 << 15; export const OTHER = 1 << 16; -export const FRAME_ANY = MAIN_FRAME | SUB_FRAME; +export const FRAME_ANY = MAIN_FRAME | SUB_FRAME | OBJECT; export const FONT_ANY = FONT | INLINE_FONT; export const INLINE_ANY = INLINE_FONT | INLINE_SCRIPT; export const PING_ANY = BEACON | CSP_REPORT | PING;