scripting.ExecutionWorld
指定通过 scripting.executeScript()
插入或通过 scripting.registerContentScripts()
注册的脚本的执行环境。
类型
该类型的取值是字符串,可能取值包括:
-
ISOLATED
内容脚本的默认执行环境。该环境与页面上下文隔离:虽然它们共享同一个文档,但全局作用域和可用的 API 不同。
-
MAIN
网页执行环境。该环境与网页共享而没有隔离。在该环境中的脚本无法访问仅供内容脚本使用的 API。
警告: 由于缺乏隔离,网页可以检测并干扰执行的代码。除非网页可以读取、访问或修改通过执行的代码流动的逻辑或数据,否则不要使用
MAIN
环境。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
ExecutionWorld | |||||||
ISOLATED | |||||||
MAIN |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
备注:
该 API 基于 Chromium 的 chrome.scripting
API。