chore: isElectronContext
This commit is contained in:
+7
-3
@@ -164,11 +164,15 @@
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
<script>
|
||||
// electron
|
||||
if (navigator.userAgent.indexOf("Electron/") > -1) {
|
||||
document.body.classList.add("electron");
|
||||
}
|
||||
if (window.location !== window.parent.location) {
|
||||
// The page is in an iframe
|
||||
document.body.classList.add("iframe");
|
||||
|
||||
+1
-5
@@ -18,13 +18,9 @@ import { register } from "./serviceWorkerRegistration";
|
||||
import "./i18n";
|
||||
import "./libs/polyfills";
|
||||
|
||||
import { isDarkMode, isElectronContext } from "./utils";
|
||||
import { isDarkMode } from "./utils";
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
||||
// electron context
|
||||
if (isElectronContext()) {
|
||||
document.body.classList.add("electron");
|
||||
}
|
||||
// dark mode
|
||||
if (isDarkMode()) {
|
||||
document.documentElement.classList.add("dark");
|
||||
|
||||
Reference in New Issue
Block a user