Skip to content

Instantly share code, notes, and snippets.

@mscottford
Created March 22, 2018 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mscottford/c545ecb3f455a16ce89ff560030178d3 to your computer and use it in GitHub Desktop.
Save mscottford/c545ecb3f455a16ce89ff560030178d3 to your computer and use it in GitHub Desktop.
// Run this from the console in Chrome when viewing an image on WallpapersCraft.
// It will download the 3840x2400 version of the image to your downloads folder.
// Example url: https://wallpaperscraft.com/wallpaper/television_wire_interference_57268
console.save = function(url) {
e = document.createEvent('MouseEvents');
a = document.createElement('a');
a.download = url;
a.href = url;
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
a.dispatchEvent(e);
};
console.save($('body > div.all > div > div.center_wb > div.wallpaper_big > div.wb_preview > div.wb_resolution > div:nth-child(7) > a:nth-child(2)')[0].href.replace(/(\d)\/(\d)/, "$1_$2").concat('.jpeg').replace('download', 'image'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment