| 38 | }; |
| 39 | |
| 40 | const backup = () => { |
| 41 | // dark mode for CRX Viewer https://chrome.google.com/webstore/detail/jifpbeccnghkjeaalbbjmodiffmgedin |
| 42 | javascript: (() => { |
| 43 | let id = "useful-scripts-darkModePDF"; |
| 44 | |
| 45 | let old = document.querySelector("#" + id); |
| 46 | if (old) old.remove(); |
| 47 | else { |
| 48 | var cover = document.createElement("div"); |
| 49 | cover.id = id; |
| 50 | cover.innerHTML = ` |
| 51 | <style> |
| 52 | #${id} { |
| 53 | position: fixed; |
| 54 | pointer-events: none; |
| 55 | top: 0; |
| 56 | left: 0; |
| 57 | width: 100vw; |
| 58 | height: 100vh; |
| 59 | background-color: #fffbfbcf; |
| 60 | mix-blend-mode: difference; |
| 61 | z-index: 99999999; |
| 62 | } |
| 63 | |
| 64 | * { |
| 65 | background-color: #fff !important; |
| 66 | color: #333; |
| 67 | } |
| 68 | </style> |
| 69 | `; |
| 70 | document.body.appendChild(cover); |
| 71 | } |
| 72 | })(); |
| 73 | |
| 74 | // bookmark |
| 75 | javascript: (() => { |
| 76 | prompt( |
| 77 | "copy this", |
| 78 | 'javascript:(()=>{let id="useful-scripts-darkModePDF";let old=document.querySelector("#"+id);if(old)old.remove();else{var cover=document.createElement("div");cover.id=id;cover.innerHTML=`<style>#${id}{position:fixed;pointer-events:none;top:0;left:0;width:100vw;height:100vh;background-color:#fffbfbcf;mix-blend-mode:difference;z-index:99999999;}*{background-color:#fff!important;color:#333;}</style>`;document.body.appendChild(cover);}})();' |
| 79 | ); |
| 80 | })(); |
| 81 | }; |