Skip to content

Instantly share code, notes, and snippets.

@kidmose
Last active September 25, 2020 10:00
Show Gist options
  • Save kidmose/fcaa93706d8e7268f774 to your computer and use it in GitHub Desktop.
Save kidmose/fcaa93706d8e7268f774 to your computer and use it in GitHub Desktop.
Bookmarklet that modifies the current url by appending a string: useful for accessing Aalborg University Library paid services from outside
# Slices a string into the url:
# - from eg.: http://link.springer.com/chapter/10.1007/978-3-642-31217-5_19#page-1
# - to eg.: http://link-springer-com.zorac.aub.aau.dk/chapter/10.1007/978-3-642-31217-5_19#page-1
# - subdomains at target are eliminate by replacing `.` with `-`
javascript: (function() {
wl = window.location.toString().split("/");
wl[2] = wl[2].replace(/\./g , "-") + ".zorac.aub.aau.dk";
window.location = wl.join("/");
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment