扩展安装后,在Safari中重新加载标签

0xh*_*yuu 0 javascript safari google-chrome-extension safari-extension

在这样的代码的safari扩展中是否有任何等价物:

chrome.tabs.getSelected(null,function(tab) { 
        chrome.tabs.reload(tab.id);
    });
This code comes from Chrome. 
Run Code Online (Sandbox Code Playgroud)

我想将此代码放到global.html中.我希望在扩展安装后立即重新加载页面.

chu*_*ter 6

var activeTab = safari.application.activeBrowserWindow.activeTab;
activeTab.url = activeTab.url;
Run Code Online (Sandbox Code Playgroud)