Script
Dark Mode for PDFs with Yomitan in Browser
Learn how to use Yomitan on browser PDFs with a custom dark mode bookmarklet that doesn't invert the Yomitan popup.
- Script
- #Dark Mode
- #Yomitan
Shared by 天 Staff
Published ·Updated

Details
Using yomitan on pdfs on the browser with 'dark mode'
Navigate to this page: https://mozilla.github.io/pdf.js/web/viewer.html
Save this code as a browser bookmark:
```js
javascript:void(function(){let inverted=document.documentElement.classList.toggle('custom-dark-mode');if(inverted){for(let i=0;i=0;j--){if(rules[j].selectorText==='html.custom-dark-mode #viewerContainer'){document.styleSheets[i].deleteRule(j)}}break}catch(e){}}}})();
`
When you need dark mode just click on the bookmark. The yomitan popup will not be swapped.
