Skip to content

Instantly share code, notes, and snippets.

@SyntaxColoring
Last active December 25, 2015 21:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SyntaxColoring/7041848 to your computer and use it in GitHub Desktop.
Save SyntaxColoring/7041848 to your computer and use it in GitHub Desktop.
A bookmarklet to view an iBoss-blocked page through Google's cache.
// This is the non-minified code.
// See below for the bookmarklet.
(function() {
var PREFIX = 'http://webcache.googleusercontent.com/search?q=cache:';
// Handle LMSD iBoss pages specially.
if (window.location.hostname == 'blocked.lmsd.org') {
var pairs = window.location.search.substring(1).split('&');
pairs.forEach(function(pair) { // Look for the blocked URL in the query string.
pair=pair.split('=');
if (pair[0] == 'bu') window.location = PREFIX + pair[1];
});
}
else window.location = PREFIX + window.location;
})();

Bookmarklet Instructions

  1. Create a new bookmark anywhere.
  2. Edit the new bookmark.
  3. Copy and paste the following code into the URL field:
javascript:(function(){var e='http://webcache.googleusercontent.com/search?q=cache:';if(window.location.hostname=='blocked.lmsd.org'){var t=window.location.search.substring(1).split('&');t.forEach(function(t){t=t.split('=');if(t[0]=='bu')window.location=e+t[1]})}else window.location=e+window.location})()

Now you can click the bookmark on any page to visit Google's cache of that page. If you click the bookmark on an LMSD iBoss "access denied" page, it will automatically take you to the cache of the blocked page rather than the cache of the "access denied" page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment