在 Safari 中关闭当前站点的所有选项卡是退出方式吗?

Is it exit way to close all tabs with CURRENT site in Safari?

作为活跃的浏览器用户,我希望能够在完成项目或完成当前站点后关闭仅与特定站点相关的所有选项卡。

我知道有快捷方式可以快速关闭所有标签页 - 当前以外的选项卡 - 网页浏览器 - 当前 window - 等等

但是没有办法只关闭想要的站点。

是否可以只快速关闭当前站点使用 浏览器或 带有 AppleScript 或 BetterTouchTool

的终端

此脚本关闭每个 window Safari 中与当前选项卡具有相同域的每个选项卡:

tell application "Safari"
    tell window 1
        set theURL to URL of current tab
    end tell
    set theDomain to my domainOfURL(theURL)
    set windowList to every window
    repeat with aWindow in windowList
        tell aWindow
            close (every tab whose URL begins with theDomain)
        end tell
    end repeat
end tell

on domainOfURL(aURL)
    set tid to my text item delimiters
    set my text item delimiters to "/"
    set theDomain to text items 1 through 3 of aURL as text
    set my text item delimiters to tid
    return theDomain
end domainOfURL