danuker Author

Hi!

Given that Sci-Hub is funded by donations, I think the script should not check if each article I visit is on Sci-Hub.

Sometimes I visit 10 articles, while trying to find the most relevant to what I'm looking for. But I only want to see one.

I think getDownloadLink should always return fallbackLink, and I modified my copy of the script to do so. That way, you don't even need it to be async:

function getDownloadLink(doiReference) {
    const fallbackLink = SCI_HUB_URL + "/" + doiReference;
      console.log("SciHub link:", fallbackLink);
    return fallbackLink;
}

Then, delete the await from const downloadLink = await getDownloadLink(doiReference);