Guest User

Untitled

a guest
Sep 15th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Unnamed Script 555489
  3. // @version 1
  4. // @grant none
  5. // @author Dildoer the Cocknight aka Taylor Wright
  6. // @include *
  7. // ==/UserScript==
  8.  
  9. //use window onload instead of document onload so you can wait for all the shit to finish loading.
  10. window.onload = function() {
  11. //grab all images at once and run that shit through a foreach loop
  12. document.querySelectorAll('img').forEach( (image, index) => {
  13. //what you want to do to each image here
  14. image.setAttribute("contextmenu", `menu${index}`),
  15. image.innerHTML = `<menu type="context" id="menu${index}"> <menuitem label="Sauce NAO" onclick="window.open('https://saucenao.com/search.php?url=${image.src}');" icon="https://saucenao.com/images/static/siteicons/tineye.ico"></menuitem> </menu> `;
  16. })}
  17.  
  18. //this is my first firefox script, I usually use chrome or moreso iridium because chrome is full of CIA niggers but here's an example for anon #714967
Advertisement
Add Comment
Please, Sign In to add comment