Advertisement
Guest User

Untitled

a guest
Feb 24th, 2008
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           image search
  3. // @namespace      image search
  4. // @include        *
  5. // ==/UserScript==
  6.  
  7. document.addEventListener('click', function(event) {
  8.     if(!event.shiftKey || !event.altKey)
  9.         return;
  10.     img = event.target;
  11.     if(img.localName != "IMG")
  12.     {
  13.         var child = document.evaluate(".//img",
  14.                 img, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  15.         if(!child)
  16.         {
  17.             GM_log("no image\n");
  18.             return;
  19.         }
  20.         img = child;
  21.     }
  22.  
  23.     GM_openInTab("http://haruhidoujins.yi.org/mi-search.php?url=" + img.src);
  24.  
  25.     event.stopPropagation();
  26.     event.preventDefault();
  27. }, true);
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement