()
| 748 | isIFrame = iframe; |
| 749 | |
| 750 | const ready = () => { |
| 751 | const success = () => { |
| 752 | disableConflictingPlugins(); |
| 753 | document.documentElement.setAttribute('data-darkreader-mode', 'dynamic'); |
| 754 | document.documentElement.setAttribute('data-darkreader-scheme', theme!.mode ? 'dark' : 'dimmed'); |
| 755 | createThemeAndWatchForUpdates(); |
| 756 | }; |
| 757 | |
| 758 | const failure = () => { |
| 759 | removeDynamicTheme(); |
| 760 | }; |
| 761 | |
| 762 | if (isDRLocked()) { |
| 763 | removeNode(document.querySelector('.darkreader--fallback')); |
| 764 | } else if (isAnotherDarkReaderInstanceActive()) { |
| 765 | interceptOldScript({ |
| 766 | success, |
| 767 | failure, |
| 768 | }); |
| 769 | } else { |
| 770 | success(); |
| 771 | } |
| 772 | }; |
| 773 | |
| 774 | if (document.head) { |
| 775 | ready(); |
no test coverage detected