Created
February 18, 2017 22:57
-
-
Save moonhouse/bbdef918bffe44ecb86f2c59fa09df40 to your computer and use it in GitHub Desktop.
Blank Spot Project - Reverse background image search bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript: var bg = jQuery('.novella-entry-mast-img').css('background-image'); if(bg===undefined) {bg = jQuery('.article-head').css('background-image');} if(bg===undefined) {bg = jQuery('img.wp-post-image')[0].src;} else {bg = bg.replace('url(','').replace(')','').replace(/\"/gi, "");} window.open('https://www.google.com/searchbyimage?image_url='+bg, '_blank'); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For a more general function the best way would be to find all background images, view thumbnails for all and let the user decide which to search for.
jQuery('[class]').filter(function() { return jQuery(this).css('background-image') !== undefined && jQuery(this).css('background-image') !== 'none'; } );