MCPcopy Index your code
hub / github.com/darkreader/darkreader / injectFontCSS

Function injectFontCSS

src/inject/dynamic-theme/index.ts:839–849  ·  view source on GitHub ↗
(fontCSS: string)

Source from the content-addressed store, hash-verified

837 }
838
839 function injectFontCSS(fontCSS: string): void {
840 const pipDoc = getPipDoc();
841 if (!pipDoc || pipDoc.querySelector('.darkreader--font-fix')) {
842 return;
843 }
844 const style = pipDoc.createElement('style');
845 style.classList.add('darkreader');
846 style.classList.add('darkreader--font-fix');
847 style.textContent = fontCSS;
848 (pipDoc.head || pipDoc.documentElement).appendChild(style);
849 }
850
851 function removeFontCSS(): void {
852 getPipDoc()?.querySelector('.darkreader--font-fix')?.remove();

Callers 1

onPiPEnterFunction · 0.85

Calls 2

getPipDocFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected