Safari扩展中的当前URL [英] Current URL in Safari Extension
问题描述
safari.application.activeBrowserWindow.activeTab.url
始终 undefined
。
知道为什么会这样吗?
推荐答案
我的印象是当加载的页面是扩展网站访问部分。
My impression is that this happens when the loaded page is not "allowed" in the Extension Website Access section of the extension’s configuration.
只有您选择的网站才会注入Web内容进入它们,只有那些网站可以使用
标签
对象的属性进行操作,例如title
和url
。
Only the websites you choose have web content injected into them, and only those websites can be manipulated using the
tab
object’s properties, such astitle
andurl
.
此外,似乎白名单和黑名单设置应用于扩展网站访问允许的任何内容。
Also, it seems that the Whitelist and Blacklist settings are applied "on top of" whatever is allowed by Extension Website Access.
首先,访问受扩展网站访问设置的限制,然后应用白名单和黑名单。
First, access is limited by the Extension Website Access settings, then the whitelist and blacklist are applied.
这篇关于Safari扩展中的当前URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!