From 6424a639f93ff8f53a64690a59bff65c4ce050ef Mon Sep 17 00:00:00 2001 From: covidisahoax Date: Thu, 28 Nov 2024 17:49:53 -0800 Subject: [PATCH] always open freetube:// links in new window --- src/main/index.js | 16 ++-------------- .../general-settings/general-settings.js | 5 ----- .../general-settings/general-settings.vue | 6 ------ src/renderer/store/modules/settings.js | 7 ------- static/locales/en-US.yaml | 1 - 5 files changed, 2 insertions(+), 33 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index ed9014f65649b..dc9edb66b7ba0 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -208,10 +208,6 @@ function runApp() { let mainWindow let startupUrl - function isOpenLinkInNewWindow() { - return sessionStorage.getItem('openLinkInNewWindow') === 'true' - } - if (process.platform === 'linux') { // Enable hardware acceleration via VA-API with OpenGL if no other feature flags are found // https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md @@ -835,11 +831,7 @@ function runApp() { ipcMain.once(IpcChannels.APP_READY, () => { if (startupUrl) { - if (isOpenLinkInNewWindow()) { - createWindow({ replaceMainWindow: false, windowStartupUrl: startupUrl, showWindowNow: true }) - } else { - mainWindow.webContents.send(IpcChannels.OPEN_URL, startupUrl) - } + createWindow({ replaceMainWindow: false, windowStartupUrl: startupUrl, showWindowNow: true }) } }) @@ -1498,11 +1490,7 @@ function runApp() { const startUrl = baseUrl(url) if (mainWindow && mainWindow.webContents) { - if (isOpenLinkInNewWindow()) { - createWindow({ replaceMainWindow: false, windowStartupUrl: startUrl, showWindowNow: true }) - } else { - mainWindow.webContents.send(IpcChannels.OPEN_URL, startUrl) - } + createWindow({ replaceMainWindow: false, windowStartupUrl: startUrl, showWindowNow: true }) } else { startupUrl = startUrl } diff --git a/src/renderer/components/general-settings/general-settings.js b/src/renderer/components/general-settings/general-settings.js index bb6d7d3da4674..b7d0f60bd7b10 100644 --- a/src/renderer/components/general-settings/general-settings.js +++ b/src/renderer/components/general-settings/general-settings.js @@ -200,10 +200,6 @@ export default defineComponent({ this.$t('Settings.General Settings.External Link Handling.Ask Before Opening Link'), this.$t('Settings.General Settings.External Link Handling.No Action') ] - }, - - openLinkInNewWindow: function () { - return this.$store.getters.getEnableOpenLinkInNewWindow } }, created: function () { @@ -273,7 +269,6 @@ export default defineComponent({ 'updateCurrentLocale', 'updateExternalLinkHandling', 'updateGeneralAutoLoadMorePaginatedItemsEnabled', - 'updateEnableOpenLinkInNewWindow', ]) } }) diff --git a/src/renderer/components/general-settings/general-settings.vue b/src/renderer/components/general-settings/general-settings.vue index f0d75901c5be8..2a77422f45959 100644 --- a/src/renderer/components/general-settings/general-settings.vue +++ b/src/renderer/components/general-settings/general-settings.vue @@ -38,12 +38,6 @@ :compact="true" @change="updateEnableSearchSuggestions" /> -
diff --git a/src/renderer/store/modules/settings.js b/src/renderer/store/modules/settings.js index dc65d99dfb1e8..0f13c80992a90 100644 --- a/src/renderer/store/modules/settings.js +++ b/src/renderer/store/modules/settings.js @@ -404,13 +404,6 @@ const stateWithSideEffects = { } }, - openLinkInNewWindow: { - defaultValue: false, - sideEffectsHandler: (_, value) => { - sessionStorage.setItem('openLinkInNewWindow', value) - } - }, - uiScale: { defaultValue: 100, sideEffectsHandler: (_, value) => { diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index 8127d7f289d38..2aa0d3e4a26a1 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -283,7 +283,6 @@ Settings: Fallback to Non-Preferred Backend on Failure: Fallback to Non-Preferred Backend on Failure Enable Search Suggestions: Enable Search Suggestions - Enable Link In New Window: Enable opening freetube:// links in a new window Auto Load Next Page: Label: Auto Load Next Page Tooltip: Load additional pages and comments automatically.