diff --git a/app/main.ts b/app/main.ts index 99258ce59e..cb38433d27 100644 --- a/app/main.ts +++ b/app/main.ts @@ -1,9 +1,6 @@ // Copyright 2017-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because it patches "os" module -import '../ts/util/patchWindows7Hostname'; - import { join, normalize } from 'path'; import { pathToFileURL } from 'url'; import * as os from 'os'; diff --git a/sticker-creator/preload.ts b/sticker-creator/preload.ts index 515c370b8d..61f756a431 100644 --- a/sticker-creator/preload.ts +++ b/sticker-creator/preload.ts @@ -1,9 +1,6 @@ // Copyright 2019-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because of monkey-patching -import '../ts/windows/shims'; - import './window/phase1-dependencies'; import './window/phase2-signal'; import './window/phase3-sticker-functions'; diff --git a/ts/util/patchWindows7Hostname.ts b/ts/util/patchWindows7Hostname.ts deleted file mode 100644 index fae77f3ca6..0000000000 --- a/ts/util/patchWindows7Hostname.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2022 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import semver from 'semver'; - -// eslint-disable-next-line @typescript-eslint/no-var-requires -const os = require('os'); - -// os.hostname() doesn't work on Windows 7 anymore -// See: https://github.com/electron/electron/issues/34404 -if (process.platform === 'win32' && semver.satisfies(os.release(), '6.1.x')) { - os.hostname = () => 'Desktop'; -} diff --git a/ts/windows/about/preload.ts b/ts/windows/about/preload.ts index fb83d1e3e5..0dc214271c 100644 --- a/ts/windows/about/preload.ts +++ b/ts/windows/about/preload.ts @@ -1,9 +1,6 @@ // Copyright 2018-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because of monkey-patching -import '../shims'; - import React from 'react'; import ReactDOM from 'react-dom'; import { contextBridge } from 'electron'; diff --git a/ts/windows/debuglog/preload.ts b/ts/windows/debuglog/preload.ts index a395e98344..3cb4d40ac3 100644 --- a/ts/windows/debuglog/preload.ts +++ b/ts/windows/debuglog/preload.ts @@ -1,9 +1,6 @@ // Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because of monkey-patching -import '../shims'; - import React from 'react'; import ReactDOM from 'react-dom'; import { contextBridge, ipcRenderer } from 'electron'; diff --git a/ts/windows/loading/preload.ts b/ts/windows/loading/preload.ts index ec5da35cc1..5dab0f95a9 100644 --- a/ts/windows/loading/preload.ts +++ b/ts/windows/loading/preload.ts @@ -1,9 +1,6 @@ // Copyright 2020-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because of monkey-patching -import '../shims'; - import { contextBridge } from 'electron'; import { SignalContext } from '../context'; diff --git a/ts/windows/main/preload.ts b/ts/windows/main/preload.ts index 9dc9424e1e..54cd76cd98 100644 --- a/ts/windows/main/preload.ts +++ b/ts/windows/main/preload.ts @@ -1,9 +1,6 @@ // Copyright 2017-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because of monkey-patching -import '../shims'; - /* eslint-disable global-require */ import * as log from '../../logging/log'; diff --git a/ts/windows/permissions/preload.ts b/ts/windows/permissions/preload.ts index 3f98f09c48..f3d264c6dc 100644 --- a/ts/windows/permissions/preload.ts +++ b/ts/windows/permissions/preload.ts @@ -1,9 +1,6 @@ // Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because of monkey-patching -import '../shims'; - import React from 'react'; import ReactDOM from 'react-dom'; import { contextBridge } from 'electron'; diff --git a/ts/windows/screenShare/preload.ts b/ts/windows/screenShare/preload.ts index a1a4ae03ca..8358d1e31c 100644 --- a/ts/windows/screenShare/preload.ts +++ b/ts/windows/screenShare/preload.ts @@ -1,9 +1,6 @@ // Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because of monkey-patching -import '../shims'; - import React from 'react'; import ReactDOM from 'react-dom'; import { contextBridge, ipcRenderer } from 'electron'; diff --git a/ts/windows/settings/preload.ts b/ts/windows/settings/preload.ts index 194434cd7c..2326bd6351 100644 --- a/ts/windows/settings/preload.ts +++ b/ts/windows/settings/preload.ts @@ -1,9 +1,6 @@ // Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// This has to be the first import because of monkey-patching -import '../shims'; - import React from 'react'; import ReactDOM from 'react-dom'; import { contextBridge, ipcRenderer } from 'electron'; diff --git a/ts/windows/shims.ts b/ts/windows/shims.ts deleted file mode 100644 index 0e9453be42..0000000000 --- a/ts/windows/shims.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2022 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import '../util/patchWindows7Hostname';