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

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