chore: isElectronContext
This commit is contained in:
@@ -169,6 +169,10 @@
|
|||||||
-->
|
-->
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
// electron
|
||||||
|
if (navigator.userAgent.indexOf("Electron/") > -1) {
|
||||||
|
document.body.classList.add("electron");
|
||||||
|
}
|
||||||
if (window.location !== window.parent.location) {
|
if (window.location !== window.parent.location) {
|
||||||
// The page is in an iframe
|
// The page is in an iframe
|
||||||
document.body.classList.add("iframe");
|
document.body.classList.add("iframe");
|
||||||
|
|||||||
+1
-5
@@ -18,13 +18,9 @@ import { register } from "./serviceWorkerRegistration";
|
|||||||
import "./i18n";
|
import "./i18n";
|
||||||
import "./libs/polyfills";
|
import "./libs/polyfills";
|
||||||
|
|
||||||
import { isDarkMode, isElectronContext } from "./utils";
|
import { isDarkMode } from "./utils";
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
||||||
// electron context
|
|
||||||
if (isElectronContext()) {
|
|
||||||
document.body.classList.add("electron");
|
|
||||||
}
|
|
||||||
// dark mode
|
// dark mode
|
||||||
if (isDarkMode()) {
|
if (isDarkMode()) {
|
||||||
document.documentElement.classList.add("dark");
|
document.documentElement.classList.add("dark");
|
||||||
|
|||||||
Reference in New Issue
Block a user