Skip to content

Instantly share code, notes, and snippets.

@azat-co

azat-co/bookmarklet

Forked from tjor/bookmarklet
Last active Aug 29, 2015
Embed
What would you like to do?
//Executed through a self-invoking anonymous function
(function(){
//declare the variables that we will need
var imgName = "10584590_588581994607732_199003263_n.jpg";
var uriA = "http://photos-e.ak.instagram.com/hphotos-ak-xfa1/10584590_588581994607732_199003263_n.jpg";
var uri1 = "http://instagram.com/p/sLLSiTCXB5/?modal=true";
var uri2 = "http://instagram.com/p/sLLSiTCXB5/";
//build the logic
if (document.URL === uri1) {
window.open(uriA, "_self");
} else if
(document.URL === uri2) {
window.open(uriA, "_self");
} else {
alert ("Sorry The image isn't here!");
}
})();
// I didn't know how to add logic to traverse the DOM and make the Image clickable.
// Started to look at that, but got lost in a spiral of Stackoverflow threads.
// document.getElementsByName(imgName===uriA);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.