Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function runApp() {

const url = getLinkUrl(commandLine)
if (url) {
mainWindow.webContents.send(IpcChannels.OPEN_URL, url)
mainWindow.webContents.send(IpcChannels.OPEN_URL, { url: url, isLaunchLink: false })
}
}
})
Expand Down Expand Up @@ -831,7 +831,7 @@ function runApp() {

ipcMain.once(IpcChannels.APP_READY, () => {
if (startupUrl) {
mainWindow.webContents.send(IpcChannels.OPEN_URL, startupUrl)
mainWindow.webContents.send(IpcChannels.OPEN_URL, { url: startupUrl, isLaunchLink: true })
}
})

Expand Down Expand Up @@ -1488,7 +1488,7 @@ function runApp() {
event.preventDefault()

if (mainWindow && mainWindow.webContents) {
mainWindow.webContents.send(IpcChannels.OPEN_URL, baseUrl(url))
mainWindow.webContents.send(IpcChannels.OPEN_URL, { url: baseUrl(url), isLaunchLink: false })
} else {
startupUrl = baseUrl(url)
}
Expand Down
9 changes: 7 additions & 2 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export default defineComponent({

externalLinkHandling: function () {
return this.$store.getters.getExternalLinkHandling
},

openLinksInNewWindow: function () {
return this.$store.getters.getOpenLinksInNewWindow
}
},
watch: {
Expand Down Expand Up @@ -512,9 +516,10 @@ export default defineComponent({
},

enableOpenUrl: function () {
ipcRenderer.on(IpcChannels.OPEN_URL, (event, url) => {
ipcRenderer.on(IpcChannels.OPEN_URL, (event, payload) => {
const { url, isLaunchLink } = payload
if (url) {
this.handleYoutubeLink(url)
this.handleYoutubeLink(url, { doCreateNewWindow: this.openLinksInNewWindow && !isLaunchLink })
}
})

Expand Down
5 changes: 5 additions & 0 deletions src/renderer/components/general-settings/general-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ 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')
]
},

openLinksInNewWindow: function () {
return this.$store.getters.getOpenLinksInNewWindow
}
},
created: function () {
Expand Down Expand Up @@ -269,6 +273,7 @@ export default defineComponent({
'updateCurrentLocale',
'updateExternalLinkHandling',
'updateGeneralAutoLoadMorePaginatedItemsEnabled',
'updateOpenLinksInNewWindow',
])
}
})
6 changes: 6 additions & 0 deletions src/renderer/components/general-settings/general-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
:compact="true"
@change="updateEnableSearchSuggestions"
/>
<ft-toggle-switch
:label="$t('Settings.General Settings.Open Links In New Window')"
:default-value="openLinksInNewWindow"
:compact="true"
@change="updateOpenLinksInNewWindow"
/>
</div>
</div>
<div class="switchGrid">
Expand Down
1 change: 1 addition & 0 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ const state = {
listType: 'grid',
maxVideoPlaybackRate: 3,
onlyShowLatestFromChannel: false,
openLinksInNewWindow: false,
playNextVideo: false,
proxyHostname: '127.0.0.1',
proxyPort: '9050',
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ Settings:
Fallback to Non-Preferred Backend on Failure: Fallback to Non-Preferred Backend
on Failure
Enable Search Suggestions: Enable Search Suggestions
Open Links In New Window: Open freetube:// Links in a New Window
Copy link
Contributor Author

@OothecaPickle OothecaPickle Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Open Links In New Window: Open freetube:// Links in a New Window
Open Links In New Window: Open URLs Passed to FreeTube in a New Window

Copy link
Contributor Author

@OothecaPickle OothecaPickle Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe "URLs Passed to FreeTube" as this setting also applies to links passed via the command line

Copy link
Member

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no objection to changing it to URLs Passed to FreeTube because that does sound clearer. If others think the messaging doesnt sound clear enough then maybe we should opt for implementing an tool tip message that explains what this does?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just add tooltip giving examples of redirect extensions (mostly from those right?
Setting External Link Handling has one

Auto Load Next Page:
Label: Auto Load Next Page
Tooltip: Load additional pages and comments automatically.
Expand Down