Skip to content

Instantly share code, notes, and snippets.

@liamengland1
Last active July 6, 2020 02:52
Show Gist options
  • Save liamengland1/496ea41042f2278f19fff594c7ba4da5 to your computer and use it in GitHub Desktop.
Save liamengland1/496ea41042f2278f19fff594c7ba4da5 to your computer and use it in GitHub Desktop.
(function() {
let l = window.location;
let u = l.href;
if (u.includes("media") && "vsco.co" == l.host) {
let currentImgId = (u.indexOf('?') == -1) ? u.substring(u.indexOf('/media/') + 7, u.length) : u.substring(u.indexOf('/media/') + 7, u.indexOf('?'));
let currentImg = document.querySelector('img[src*="' + currentImgId + '"]:not([srcset])');
let src = currentImg.src;
let fullsize = src.substring(0, src.indexOf("?"));
window.open(fullsize);
} else {
alert("fail");
}
})();
@liamengland1
Copy link
Author

https://mrcoles.com/bookmarklet/

@liamengland1
Copy link
Author

liamengland1 commented Jul 6, 2020

javascript:(function()%7B(function()%20%7Blet%20l%20%3D%20window.location%3Blet%20u%20%3D%20l.href%3Bif%20(u.includes(%22media%22)%20%26%26%20%22vsco.co%22%20%3D%3D%20l.host)%20%7Blet%20currentImgId%20%3D%20(u.indexOf('%3F')%20%3D%3D%20-1)%20%3F%20u.substring(u.indexOf('%2Fmedia%2F')%20%2B%207%2C%20u.length)%20%3A%20u.substring(u.indexOf('%2Fmedia%2F')%20%2B%207%2C%20u.indexOf('%3F'))%3Blet%20currentImg%20%3D%20document.querySelector('img%5Bsrc*%3D%22'%20%2B%20currentImgId%20%2B%20'%22%5D%3Anot(%5Bsrcset%5D)')%3Blet%20src%20%3D%20currentImg.src%3Blet%20fullsize%20%3D%20src.substring(0%2C%20src.indexOf(%22%3F%22))%3Bwindow.open(fullsize)%3B%7D%20else%20%7Balert(%22fail%22)%3B%7D%7D)()%7D)()

@liamengland1
Copy link
Author

javascript:(function()%7B!function()%7Blet%20e%3Dwindow.location%2Ci%3De.href%3Bif(i.includes(%22media%22)%26%26%22vsco.co%22%3D%3De.host)%7Blet%20e%3D-1%3D%3Di.indexOf(%22%3F%22)%3Fi.substring(i.indexOf(%22%2Fmedia%2F%22)%2B7%2Ci.length)%3Ai.substring(i.indexOf(%22%2Fmedia%2F%22)%2B7%2Ci.indexOf(%22%3F%22))%2Cn%3Ddocument.querySelector('img%5Bsrc*%3D%22'%2Be%2B'%22%5D%3Anot(%5Bsrcset%5D)').src%2Cs%3Dn.substring(0%2Cn.indexOf(%22%3F%22))%3Bwindow.open(s)%7Delse%20alert(%22fail%22)%7D()%7D)()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment