0
我試圖做一個擴展,關閉所有選項卡,但Safari中當前窗口的活動選項卡。我已經完成了關閉所有選項卡,但索引1。但我需要插入activetab索引並排除關閉。如果我得到答案,我會把它放在擴展名中併發布它。返回Safari 5擴展的Activetab索引
<!DOCTYPE HTML>
<script>
safari.application.addEventListener("command", performCommand, false);
safari.application.addEventListener("validate", validateCommand, false);
function performCommand(event)
{
if (event.command !== "closer")
return;
var tabss = safari.application.activeBrowserWindow.tabs;
for (j=1; j<tabss.length; j++) {
event.target.browserWindow.activeTab.close();
}
}
</script>