doi-bookmarklet

View the Project on GitHub Clinteger/doi-bookmarklet

About

The DOI Bookmarklet opens access-restricted documents (like scientific journals) by redirecting through a ProQuest EZproxy as used by many university libraries.

Installation

Enter your ProQuest EZproxy URL:

Bookmark the following link: DOI Bookmarklet

The bookmarklet consists of the following JavaScript minified:

(function() {
    var proxyUrl = "http://proxy.lib.umich.edu";
    var selection = document.getSelection ? document.getSelection().toString() : document.selection.createRange().text;
    var regex = /\w?(?:doi:|hdl:(?:\/\/)?)\s*([0-9./a-z]+)\w?/i;
    var match = regex.exec(selection);
    if (match != null) {
        var doi = match[1];
        var tempAnchor = document.createElement('a');
        tempAnchor.href = proxyUrl;
        document.location = tempAnchor.protocol + '//dx.doi.org.' + tempAnchor.host + '/' + doi;
    }
})();

How it works

The bookmarklet searches the currently selected text for a DOI (beginning with doi: or hdl:) and routes the subsequent request to http://dx.doi.org through the specified proxy.

License

Public Domain Mark

This work is free of known copyright restrictions.