Skip to content

Instantly share code, notes, and snippets.

@jpgninja
Last active March 24, 2019 18:13
Show Gist options
  • Save jpgninja/9df2ee4c244f80fa38cd56d5aa26545a to your computer and use it in GitHub Desktop.
Save jpgninja/9df2ee4c244f80fa38cd56d5aa26545a to your computer and use it in GitHub Desktop.
Bookmarklets
!function() {
function init() {
var photoUrl;
// Amazon
// photoUrl = jQuery('.imageViewContainer img')[0].src; // User review image.
photoUrl = jQuery('#ivLargeImage img')[0].src; // Product image.
openPhotoInNewTab( photoUrl );
}
function openPhotoInNewTab( url ) {
window.open( url, "_blank" )
}
if ("undefined" == typeof jQuery) {
var t = document.createElement("script"),
a = document.getElementsByTagName("head")[0];
t.src = "//code.jquery.com/jquery.min.js",
t.onload = t.onreadystatechange = function() {
init()
},
a.appendChild(t);
}
else {
init();
}
}();
!function() {
function init() {
var photoUrl;
// Flickr
// photoUrl = $('._jjzlb img')[0].src.split('?')[0];
openPhotoInNewTab( photoUrl );
}
function openPhotoInNewTab( url ) {
window.open( url, "_blank" )
}
if ("undefined" == typeof jQuery) {
var t = document.createElement("script"),
a = document.getElementsByTagName("head")[0];
t.src = "//code.jquery.com/jquery.min.js",
t.onload = t.onreadystatechange = function() {
init()
},
a.appendChild(t);
}
else {
init();
}
}();
!function() {
function init() {
// Instagram
let photoUrl = document.getElementsByClassName('FFVAD')[0].src;
openPhotoInNewTab( photoUrl );
}
function openPhotoInNewTab( url ) {
window.open( url, "_blank" )
}
init();
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment