mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Check userAgent before running electron init
This commit is contained in:
parent
6d8df6744e
commit
6c3618cb65
@ -417,11 +417,15 @@ function calculateAchievements(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function initElectron(): void {
|
export function initElectron(): void {
|
||||||
|
const userAgent = navigator.userAgent.toLowerCase();
|
||||||
|
if (userAgent.indexOf(' electron/') > -1) {
|
||||||
|
// Electron-specific code
|
||||||
setAchievements([]);
|
setAchievements([]);
|
||||||
initWebserver();
|
initWebserver();
|
||||||
setInterval(calculateAchievements, 5000);
|
setInterval(calculateAchievements, 5000);
|
||||||
initAppNotifier();
|
initAppNotifier();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function initWebserver(): void {
|
function initWebserver(): void {
|
||||||
(document as any).saveFile = function (filename: string, code: string): string {
|
(document as any).saveFile = function (filename: string, code: string): string {
|
||||||
|
Loading…
Reference in New Issue
Block a user