identity.getRedirectURL()
生成一个可用作重定向 URL 的 URL。
这一 URL 将派生自你的扩展 ID,因此如果你使用此函数,你应该使用 browser_specific_settings
键显式设置扩展的 ID(否则每次你临时安装扩展时都会得到不同的重定向 URL)。
参见获取重定向 URL 一节以获取更多关于重定向 URL 的信息。
语法
js
let redirectURL = browser.identity.getRedirectURL()
参数
无。
返回值
包含重定向 URL 值的字符串。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
getRedirectURL |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No 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.
示例
获取重定向 URL:
js
let redirectURL = browser.identity.getRedirectURL();
示例扩展
备注:
该 API 基于 Chromium 的 identity
API。