Created
May 8, 2015 15:12
-
-
Save MayaLekova/368ff771d83972dc201c to your computer and use it in GitHub Desktop.
JPGtoLinkAdder
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
// ==UserScript== | |
// @name JPGtoLinkAdder | |
// @namespace mayalekova | |
// @description Adds "?.jpg" to all links on the page (as described in http://debuggable.com/posts/hacking-a-commercial-airport-wlan:480f4dd5-50a0-40c6-aa60-4afccbdd56cb) | |
// @version 1 | |
// @grant none | |
var anchors = document.getElementsByTagName("a"); | |
for(var idx = 0; idx < anchors.length; idx++) { | |
if(anchors[idx].href.indexOf('?') >= 0){ | |
anchors[idx].href += '&.jpg'; | |
} else { | |
anchors[idx].href += '?.jpg'; | |
} | |
} | |
// ==/UserScript== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment