ReadComicOnline - Fix image

Put the image url in src attribute instead of transparent placeholder. Allows right-click save

  1. // ==UserScript==
  2. // @name ReadComicOnline - Fix image
  3. // @namespace https://github.com/Procyon-b
  4. // @version 1
  5. // @description Put the image url in src attribute instead of transparent placeholder. Allows right-click save
  6. // @author Achernar
  7. // @match https://readcomiconline.li/Comic/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. "use strict";
  13.  
  14. new MutationObserver(function(mutL){
  15. for (let mut of mutL) {
  16. let t,tr;
  17. if ( (t=mut.target) && (t.tagName=='IMG') ) {
  18. let src=t.style.backgroundImage.replace(/^.*"([^"]+)".*$/, "$1");
  19. if (src && (t.src != src) ) t.src=src;
  20. }
  21. }
  22. }).observe(document.body, {childList: false, subtree: true, attributes: true, attributeFilter: ['style'] });
  23.  
  24. })();