webextension-native-mathml
webextension-native-mathml copied to clipboard
Math expression will be blank if a website use MathJax 3 but disabled AssistiveMml
Our code doesn't detect whether MathML output exists, although it's the default, but it can be disabled or ignored (because it needs to be called explicitly in Non-Component-Based way) by the developer. I have a small change to fix it, just change https://github.com/fred-wang/webextension-native-mathml/blob/efc03f1b6066b27edad421ccb45dfe86455cf922/content-scripts/mathjax-v3.css#L7-L13 to
/* Hide MathJax's own output when MathML existed. */
mjx-container:has(mjx-assistive-mml) mjx-math {
display: none !important;
}
mjx-container:has(mjx-assistive-mml) svg {
display: none !important;
}
So the hidden logic will take effect only when MathML output exists. But it has a critical issue: :has only been supported since Chromium 105 (Release date: 2022-09-02) and Firefox 121 (Release date: 2023-12-19)^1. So I post here and expect someone to find a way without :has