The same thing happens with <a href="https://www.wolframalpha.com" rel="nofollow noreferrer">https://www.wolframalpha.com</a> for me in Safari on macOS, where I frequenly get 250% CPU usage. Even with <i>Safari->Develop->Disable JavaScript</i>, after showing the Develop menu with <i>Safari->Preferences...->Advanced->Show Develop menu in menu bar</i>. Sounds like it's due to the css using time or animations. I can't find a fix for it, other than disabling <i>Safari->Develop->Disable Styles</i>, but who wants to surf the web without css?<p>Here is an AppleScript I've hacked together over time to show the Safari tab for a PID from Activity Monitor so it can be closed, note that I'm on macOS 10.13.6 on this old 2011 Mac Mini, using Safari 13.1.2, so YMMV:<p><pre><code> -- launch Activity Monitor to find the PID of a misbehaving tab and show it with this script
-- ensure that Safari->Debug->Miscellaneous Flags->Show Web Process IDs in Page Titles is enabled
tell application "System Events" to tell process "Safari"
-- ensure that user has enabled assistive access
try
menu 1 of menu bar item "Safari" of menu bar 1 -- throws exception if menu not visible
on error
display dialog "Please enable assistive access for this script by dragging it into the list of apps in:
System Preferences->Security & Privacy->Privacy->Accessibility
(It must be disabled and re-enabled each time this script is edited)" buttons {"OK"} default button "OK"
return
end try
-- ensure that user has enabled Show Web Process IDs in Page Titles
try
set debugMenu to menu 1 of menu bar item "Debug" of menu bar 1 -- throws exception if menu not visible
on error
display dialog "Enable Debug menu in Safari? It will be relaunched but preserve any open windows." -- stops script if Cancel is clicked
do shell script "defaults write com.apple.Safari IncludeInternalDebugMenu 1 && killall Safari && osascript -e 'tell application \"Safari\" to activate'" -- force quit Safari to preserve windows on relaunch
return
end try
tell menu item "Show Web Process IDs in Page Titles" of menu 1 of menu item "Miscellaneous Flags" of debugMenu
if (value of attribute "AXMenuItemMarkChar" as string) is "missing value" then click
end tell
end tell
-- show tab matching string, prepopulated with [WP _pid_]
set searchString to text returned of (display dialog "Please enter a string to find the Safari tab containing it:
([WP _pid_] from Activity Monitor for convenience)" default answer "[WP _pid_]")
tell application "Safari"
-- bring frontmost to avoid App Tamer from slowing script
activate
repeat with w from 1 to count of windows
repeat 1 times
try
set theTab to (first tab of window w whose name contains searchString)
on error
exit repeat
end try
set current tab of window w to theTab
-- work around a bug/feature of Safari where windows lack a way to bring them to front
if index of window w is not 1 then
set index of window w to 2
tell application "System Events"
tell application process "Safari"
keystroke "`" using command down
end tell
end tell
end if
return
end repeat
end repeat
display dialog "Couldn't find tab containing \"" & searchString & "\"." buttons {"OK"} default button "OK"
end tell
</code></pre>
Just open Script Editor, paste it in and save it as an application under <i>~/Library/Scripts</i> or by choosing <i>Script menu->Open Scripts Folder->Open User Scripts Folder</i>. The Script menu can be shown via <i>Script Editor->Preferences->General->Show Script menu in menu bar</i>. Then run it and follow the prompts to ensure that assistive access has been enabled and that tabs show their PID.<p>The script is loosely derived from:<p><a href="https://hea-www.harvard.edu/~fine/OSX/safari-tabs.html" rel="nofollow noreferrer">https://hea-www.harvard.edu/~fine/OSX/safari-tabs.html</a><p><a href="https://apple.stackexchange.com/questions/45768/how-can-i-figure-out-which-tab-in-safari-is-using-cpu" rel="nofollow noreferrer">https://apple.stackexchange.com/questions/45768/how-can-i-fi...</a><p>I tried to make a version that just shows the Safari tab having a pid, but lost a day to it doing a deep dive into listing windows and their pid:<p><a href="https://stackoverflow.com/questions/48058409/get-windows-with-same-process-name-but-different-pid-in-applescript" rel="nofollow noreferrer">https://stackoverflow.com/questions/48058409/get-windows-wit...</a><p><a href="https://stackoverflow.com/questions/14551419/listing-all-windows-of-all-applications" rel="nofollow noreferrer">https://stackoverflow.com/questions/14551419/listing-all-win...</a><p><a href="https://stackoverflow.com/questions/42018149/get-pids-of-all-open-windows-on-macos" rel="nofollow noreferrer">https://stackoverflow.com/questions/42018149/get-pids-of-all...</a><p>Unfortunately Apple made AppleScript and Automator so arduous to use that I consider them adversarial programming. Like with MS Visual Basic, there's usually less than 50% odds of getting a script to work, regardless of how experienced the developer is. Certainly 0% without resources like web forum posts.<p>Web browsers are even worse, in the sense that they're written for users instead of developers. Some low-hanging fruit would be to pause all non-focused tabs after a configurable period of time, so that they only use memory. I've wanted that since I first saw NCSA Mosaic in 1995, along with a great many other improvements which the powers that be seem to work tirelessly to prevent. Blah.