Last active
August 29, 2015 14:00
-
-
Save andrewgiessel/11187054 to your computer and use it in GitHub Desktop.
bookmarklet to automatically proxify a page for harvard's library system
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
// most recent update: 04/22/2014 | |
// one liner | |
javascript:function go(){var asdf = window.location.host.replace(/\./g, "-");window.location = window.location.protocol+'//'+asdf+'.ezp1.harvard.edu'+window.location.pathname+window.location.search;}go();void(0); | |
// expanded | |
function go() { | |
var asdf = window.location.host.replace(/\./g, "-"); // replace all the periods with dashes (uses regexp) | |
window.location = window.location.protocol+'//' + | |
asdf + | |
'.ezp1.harvard.edu' + | |
window.location.pathname + | |
window.location.search; | |
} | |
go(); | |
void(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment