Advertisement
Normantas

Diofy extension 0.00000001 ver

Sep 14th, 2020 (edited)
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. //TODO Add a settings folder
  2. let autorun = true;
  3. //TODO Change to in computer files, quicker load times
  4. const imageLocation = "https://i.kym-cdn.com/photos/images/newsfeed/000/754/539/566.gif"
  5.  
  6. function main(){
  7. if(autorun)
  8. RunDiofy();
  9. }
  10.  
  11. //DIOfies the DOM
  12. function RunDiofy(){
  13. document.addEventListener("load",turnEveryImageToDio())
  14. //Observes mutations to the dom, calls out a callback function when notices a mutation to the body
  15. const mutationObserverConfig = {attributes:true, childlist:true, subtree: true};
  16. let observer = new MutationObserver(turnEveryImageToDio);
  17. observer.observe(document,mutationObserverConfig);
  18.  
  19. }
  20.  
  21. function turnEveryImageToDio()
  22. {
  23. //Turns every image to dio before loading JS.
  24. let images = document.getElementsByTagName("img");
  25.  
  26. //img stands for image
  27. for(let img of images){
  28. img.src = imageLocation;
  29. }
  30. return images.length;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement