Skip to content

Instantly share code, notes, and snippets.

@SichangHe
SichangHe / highlight_elem.js
Last active April 29, 2025 03:01
Script to run in a browser to highlight elements on HTML page, contributed by @huanchen-stack
(() => {
const HIGHLIGHT_CONTAINER_ID = 'highlight-container';
function isInteractiveElement(element) {
if (!element || element.nodeType !== Node.ELEMENT_NODE) {
return false;
}
// Base interactive elements and roles
const interactiveElements = new Set([
Make Mathjax synchronous
```html
<!-- MathJax -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: {inlineMath: [["$","$"]]} })
</script>
```