简体   繁体   中英

make HTML generated by content scripts of extensions inaccessible to page scripts

I would like to show HTML elements generated by extension content scripts over/inside the window area but make them inaccessible for site scripts so the page could not potentially detect/modify them through DOM. Are there any techniques specific for extension development which would allow to do this? Like layering or so

There aren't any special Chrome Extension techniques for this. As you'll read here , JavaScript injected via a content script is automatically sandboxed, or separated from the JavaScript on a web page, but this is not the case for HTML -- the DOM elements are shared between the page scripts and the injected content scripts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM