Created
November 22, 2010 20:55
-
-
Save hal0thane/710663 to your computer and use it in GitHub Desktop.
Fast and easy script to reload all the tabs in your front window in Google Chrome. Change the app name and it works in Chromium.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
* | |
* App: Google Chrome | |
* Author: Billy H~ ‹-gitster [@] hal0thane net-› | |
* Updated: 2010-11-22 | |
* | |
* Rationale: | |
* I tend to have open many (very many) browser tabs at the same time, | |
* which is one of the only things that Google Chrome does not seem to | |
* handle quite well. As a result, Chrome tends to flip out and require me | |
* to reload all the tabs in the current window (or, sometimes, only the | |
* only tabs from the same domain as the last one opened) in order to | |
* get back my browser session. That's not so bad in comparison to | |
* dumping core and heading for the hills. | |
* This app makes it a lot easier for lazy people like me to reload all | |
* those tabs. Especially when there are 20 or 30 of them in the window | |
* that need to be reloaded. Without the TabMixPlus extension that makes | |
* Firefox barely tolerable (and includes the ability to reload all tabs), | |
* this is the next best thing... that I've found. And I only found it | |
* because I wrote it. Well, it's not like I went looking for it. I mean, | |
* hey! Listen up! I just said I was lazy. | |
*) | |
(* | |
* H O W T O U S E | |
********************* | |
* I'll let you figure that much out for yourself. You're a smart one. | |
* | |
* But I will say... You don't want to set this value any lower than the | |
* default, unless you've got a Mac built in 2010 or later and your system load | |
* is pretty light. | |
*) | |
property reload_delay : 5.0 -- Delay between tab reloads to reduce system lag | |
(* | |
****************************************************************************** | |
* NO EDITS BELOW HERE | |
* (unless you know what you're doing or you just want to be an asshole) | |
****************************************************************************** | |
*) | |
tell application "Google Chrome" | |
-- set win { winid : id , tlist : tabs , tcnt : count of tabs } of front window | |
set tlist to tabs of front window | |
set dlmsg to "Reload " & (count of tlist) & ¬ | |
" tabs of the front Chrome window." & " Are you sure?" | |
if (button returned of ¬ | |
(display dialog dlmsg buttons {"Ok", "Cancel"} ¬ | |
default button 2 with title "Google Chrome") is "Ok") then | |
repeat with t in tlist | |
reload t | |
delay reload_delay | |
end repeat | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment