Peak Users: 11
Date: May 8, 2024
URL: Chrome
Webstore
MutationObserver
to monitor changes in the DOM and apply a
callback whenever the document updates.<pre>
tags, so my script loops through the document
on each DOM change to check for this tag.<pre>
tag is found, I apply syntax highlighting using a minified version of
highlight.js with pre-selected languages and retrieve the current theme from
chrome.storage.local
.
<pre>
tags after
applying highlighting. This allowed the script to quickly check for the attribute before reapplying,
improving efficiency. Since the MutationObserver
monitors the entire document, this
optimization roughly doubled performance, providing a seamless user experience.Key Features: