Last active
December 13, 2020 17:59
-
-
Save McPolemic/6196127 to your computer and use it in GitHub Desktop.
Open embedded PDF bookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var objects=document.getElementsByTagName("object");for(i=0;i<objects.length;i++){data=objects[i].getAttribute("data");if(data.indexOf("pdf")!=-1)document.location=data;}})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { | |
var objects = document.getElementsByTagName("object"); | |
for(i=0;i<objects.length;i++) | |
{ | |
// Loop through all object elements, looking for something with a data=file.pdf | |
data=objects[i].getAttribute('data'); | |
if(data.indexOf('pdf') != -1) | |
document.location=data; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment