Open carlosjeurissen opened 3 years ago
I'm confused what that is hardening about content scripts. Is this about requiring the frame to be embedded in only one of the matching main_frame_origins
?
It's not about making frames embedded-able. Sometimes extensions only want to inject a content_script
in a specific sub_frame
and not in the main_frame
. There are specific websites (any website by default) which can be embedded on another website in an iframe. Thus if an extension wants to inject a content_script in these sub_frames
on specific websites, it might open up holes in other websites where this specific sub_frame
can also be embedded.
To reduce the attack surface of
content_scripts
, I'm proposing to allow authors to restrictcontent_scripts.all_frames
to specificmain_frame
origins or matches. Imagine it like this:This makes sure content-scripts are not changing anything in situations they are not meant to make changes.
Basically the goal here is to only inject content_scripts if and only if the parent frame matches what the author specified.