Created
June 8, 2011 00:08
-
-
Save subtleGradient/1013516 to your computer and use it in GitHub Desktop.
Refreshes the CSS in every Safari document using reCSS
This file contains hidden or 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
| #!/usr/bin/env osascript | |
| -- Refreshes the CSS in every Safari document | |
| -- Using the bookmarklet found at http://dojotoolkit.org/~david/recss.html | |
| -- | |
| -- Converted to Applescript by Thomas Aylott - http://subtleGradient.com | |
| tell app "Safari"¬ | |
| to do JavaScript "!function(){ var links = document.getElementsByTagName('link'); for (var i=0, link; link = links[i++];){ if (link.href && String(link.rel).toLowerCase().indexOf('stylesheet') >= 0){ var href = link.href.replace(/[&?]reCSS=\\d+/, ''); link.href = href + (href.indexOf('?') >= 0 ? '&' : '?') + 'reCSS=' + (+new Date); } } }()"¬ | |
| in every document |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment