Current URL in Safari Extension

2019-06-16 18:28发布

safari.application.activeBrowserWindow.activeTab.url is always undefined.

Any idea why this might be?

1条回答
劫难
2楼-- · 2019-06-16 19:07

My impression is that this happens when the loaded page is not “allowed” in the Extension Website Access section of the extension’s configuration.

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 as title and url.

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.

查看更多
登录 后发表回答