Skip to content

Instantly share code, notes, and snippets.

@lamarqua
Last active December 8, 2020 19:39
Show Gist options
  • Select an option

  • Save lamarqua/7f95fddb2c01d0f251401f440eda439d to your computer and use it in GitHub Desktop.

Select an option

Save lamarqua/7f95fddb2c01d0f251401f440eda439d to your computer and use it in GitHub Desktop.
javascript:(function()%7Bjavascript%3A%20(function()%20%7Bvar%20rejectScriptTextFilter%20%3D%20%7B%20acceptNode%3A%20function(node)%20%7Bif%20(node.parentNode.nodeName%20!%3D%3D%20'SCRIPT')%20%7Breturn%20NodeFilter.FILTER_ACCEPT%3B%7D%7D%7D%3Bvar%20re%20%3D%20%2F10.%5Cd%7B4%2C9%7D%5C%2F%5B-._%3B()%2F%3AA-Z0-9%5D%2B%2Fi%3Bvar%20n%2C%20walk%3Ddocument.createTreeWalker(document.body%2CNodeFilter.SHOW_TEXT%2CrejectScriptTextFilter%2Cfalse)%3Bwhile%20(n%3Dwalk.nextNode())%20%7Bvar%20text%20%3D%20n.wholeText%3Bvar%20found%20%3D%20text.match(re)%3Bif%20(found)%20%7Bwindow.location.href%20%3D%20%22http%3A%2F%2Fsci-hub.st%2F%22%20%2B%20found%3B%7D%7D%7D)()%7D)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment