Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 1.03 KB

darkmodepdf-js.md

File metadata and controls

9 lines (8 loc) · 1.03 KB
title date categories
DarkModePDF.Js
2023-11-23
useful-script-en

how to add bookmarklet in chrome
export default { icon: ``, name: { en: “Darkmode for pdf”, vi: “Chế độ tối cho PDF”, }, description: { en: “Enable/Disable darkmode for PDF”, vi: “Bật/Tắt chế độ tối cho PDF bạn đang xem”, }, onClick: function () { let id = “useful-scripts-darkModePDF”; let old = document.querySelector(“#” + id); if (old) old.remove(); else { var cover = document.createElement(“div”); cover.id = id; let css = `position: fixed; pointer-events: none; top: 0; left: 0; width: 100vw; height: 100vh; background-color: #fffbfbcf; mix-blend-mode: difference; z-index: 99999;`; cover.setAttribute(“style”, css); document.body.appendChild(cover); } }, };