javascript/background.js
//          like inaccessible tabs. Be careful here!
like inaccessible tabs. Be careful here!
like inaccessible tabs . Be careful here!
function checkNavObject(frameId, tabId, url) {
    if (optAutoRedirect && frameId === 0) {
        var parsedURL = parseUri(url);
        if (parsedURL.host == "www.ncbi.nlm.nih.gov") {
            if (!rewrotePubMedThisSession) {
                if (parsedURL.relative == "/pubmed/" || parsedURL.relative == "/pubmed"
                    || parsedURL.relative == "/pmc/" || parsedURL.relative.match(/^\/pubmed\/\d{6,}$/)) {
                    doRedirectToProxy(tabId, parsedURL, "?otool=flumrlib");
                    rewrotePubMedThisSession = true;
                    setTimeout(function(){ rewrotePubMedThisSession = false; }, 7200000); 
                }
            }
        }  else if (!onNetwork) {
            checkURLforRedirection(tabId, parsedURL);
        }
    }
}
function checkNavObject ( frameId , tabId , url ) { if ( optAutoRedirect && frameId === 0 ) { var parsedURL = parseUri ( url ) ; if ( parsedURL . host == "www.ncbi.nlm.nih.gov" ) { if ( ! rewrotePubMedThisSession ) { if ( parsedURL . relative == "/pubmed/" || parsedURL . relative == "/pubmed" || parsedURL . relative == "/pmc/" || parsedURL . relative . match ( / ^\/pubmed\/\d{6,}$ / ) ) { doRedirectToProxy ( tabId , parsedURL , "?otool=flumrlib" ) ; rewrotePubMedThisSession = true ; setTimeout ( function ( ) { rewrotePubMedThisSession = false ; } , 7200000 ) ; } } } else if ( ! onNetwork ) { checkURLforRedirection ( tabId , parsedURL ) ; } } }
like inaccessible tabs.
like inaccessible tabs .
// Only listen in the main frame at frameId=0 // Should we check for redirect loops, like with web.mit.edu? // frameId will match "0" for webNavigation object, and "Undefined" for tabs // Redirect PubMed journals to add ?holding flag. // This is useful whether we are on or off network. // Redirect with no proxy url, but an appendString // Re-do this every 2 hours.