Skip to content

Commit eae8319

Browse files
authored
Merge branch 'development' into tray
2 parents 2633f8f + ec6f37b commit eae8319

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1711
-1483
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"path-browserify": "^1.0.1",
6868
"portal-vue": "^2.1.7",
6969
"process": "^0.11.10",
70-
"shaka-player": "^4.13.4",
70+
"shaka-player": "^4.13.6",
7171
"swiper": "^11.2.4",
7272
"vue": "^2.7.16",
7373
"vue-i18n": "^8.28.2",
@@ -83,11 +83,11 @@
8383
"@double-great/stylelint-a11y": "^3.0.4",
8484
"@eslint/js": "^9.21.0",
8585
"@intlify/eslint-plugin-vue-i18n": "^3.2.0",
86-
"babel-loader": "^9.2.1",
87-
"copy-webpack-plugin": "^12.0.2",
86+
"babel-loader": "^10.0.0",
87+
"copy-webpack-plugin": "^13.0.0",
8888
"css-loader": "^7.1.2",
8989
"css-minimizer-webpack-plugin": "^7.0.0",
90-
"electron": "^34.2.0",
90+
"electron": "^34.3.0",
9191
"electron-builder": "^25.1.8",
9292
"eslint": "^9.21.0",
9393
"eslint-plugin-jsdoc": "^50.6.3",
@@ -100,15 +100,15 @@
100100
"html-webpack-plugin": "^5.6.3",
101101
"js-yaml": "^4.1.0",
102102
"json-minimizer-webpack-plugin": "^5.0.0",
103-
"lefthook": "^1.11.0",
103+
"lefthook": "^1.11.2",
104104
"mini-css-extract-plugin": "^2.9.2",
105105
"neostandard": "^0.12.1",
106106
"npm-run-all2": "^7.0.2",
107107
"postcss": "^8.5.3",
108108
"postcss-scss": "^4.0.9",
109-
"sass": "^1.85.0",
109+
"sass": "^1.85.1",
110110
"sass-loader": "^16.0.5",
111-
"stylelint": "^16.14.1",
111+
"stylelint": "^16.15.0",
112112
"stylelint-config-sass-guidelines": "^12.1.0",
113113
"stylelint-config-standard": "^37.0.0",
114114
"stylelint-high-performance-animation": "^1.11.0",
@@ -120,6 +120,6 @@
120120
"webpack": "^5.98.0",
121121
"webpack-cli": "^6.0.1",
122122
"webpack-dev-server": "^5.2.0",
123-
"yaml-eslint-parser": "^1.2.3"
123+
"yaml-eslint-parser": "^1.3.0"
124124
}
125125
}

src/constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const IpcChannels = {
44
DISABLE_PROXY: 'disable-proxy',
55
OPEN_EXTERNAL_LINK: 'open-external-link',
66
GET_SYSTEM_LOCALE: 'get-system-locale',
7-
GET_PICTURES_PATH: 'get-pictures-path',
87
GET_NAVIGATION_HISTORY: 'get-navigation-history',
98
SHOW_SAVE_DIALOG: 'show-save-dialog',
109
STOP_POWER_SAVE_BLOCKER: 'stop-power-save-blocker',
@@ -48,6 +47,7 @@ const IpcChannels = {
4847

4948
GENERATE_PO_TOKEN: 'generate-po-token',
5049

50+
GET_SCREENSHOT_FALLBACK_FOLDER: 'get-screenshot-fallback-folder',
5151
CHOOSE_DEFAULT_FOLDER: 'choose-default-folder',
5252
WRITE_SCREENSHOT: 'write-screenshot',
5353
}

src/main/index.js

+16-6
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ function runApp() {
293293
})
294294
}
295295

296+
let proxyUrl
297+
296298
app.on('ready', async (_, __) => {
297299
if (process.env.NODE_ENV === 'production') {
298300
protocol.handle('app', async (request) => {
@@ -412,8 +414,10 @@ function runApp() {
412414
}
413415

414416
if (useProxy) {
417+
proxyUrl = `${proxyProtocol}://${proxyHostname}:${proxyPort}`
418+
415419
session.defaultSession.setProxy({
416-
proxyRules: `${proxyProtocol}://${proxyHostname}:${proxyPort}`
420+
proxyRules: proxyUrl
417421
})
418422
}
419423

@@ -960,18 +964,20 @@ function runApp() {
960964
})
961965

962966
ipcMain.handle(IpcChannels.GENERATE_PO_TOKEN, (_, visitorData) => {
963-
return generatePoToken(visitorData)
967+
return generatePoToken(visitorData, proxyUrl)
964968
})
965969

966970
ipcMain.on(IpcChannels.ENABLE_PROXY, (_, url) => {
967971
session.defaultSession.setProxy({
968972
proxyRules: url
969973
})
974+
proxyUrl = url
970975
session.defaultSession.closeAllConnections()
971976
})
972977

973978
ipcMain.on(IpcChannels.DISABLE_PROXY, () => {
974979
session.defaultSession.setProxy({})
980+
proxyUrl = undefined
975981
session.defaultSession.closeAllConnections()
976982
})
977983

@@ -1048,10 +1054,6 @@ function runApp() {
10481054
return app.getSystemLocale()
10491055
})
10501056

1051-
ipcMain.handle(IpcChannels.GET_PICTURES_PATH, () => {
1052-
return app.getPath('pictures')
1053-
})
1054-
10551057
// Allows programmatic toggling of fullscreen without accompanying user interaction.
10561058
// See: https://developer.mozilla.org/en-US/docs/Web/Security/User_activation#transient_activation
10571059
ipcMain.on(IpcChannels.REQUEST_FULLSCREEN, ({ sender }) => {
@@ -1078,6 +1080,14 @@ function runApp() {
10781080
})
10791081
}
10801082

1083+
ipcMain.handle(IpcChannels.GET_SCREENSHOT_FALLBACK_FOLDER, (event) => {
1084+
if (!isFreeTubeUrl(event.senderFrame.url)) {
1085+
return
1086+
}
1087+
1088+
return path.join(app.getPath('pictures'), 'Freetube')
1089+
})
1090+
10811091
ipcMain.on(IpcChannels.CHOOSE_DEFAULT_FOLDER, async (event, kind) => {
10821092
if (!isFreeTubeUrl(event.senderFrame.url) || (kind !== DefaultFolderKind.DOWNLOADS && kind !== DefaultFolderKind.SCREENSHOTS)) {
10831093
return

src/main/poTokenGenerator.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import { join } from 'path'
1010
* as the BotGuard stuff accesses the global `document` and `window` objects and also requires making some requests.
1111
* So we definitely don't want it running in the same places as the rest of the FreeTube code with the user data.
1212
* @param {string} visitorData
13+
* @param {string|undefined} proxyUrl
1314
* @returns {Promise<string>}
1415
*/
15-
export async function generatePoToken(visitorData) {
16+
export async function generatePoToken(visitorData, proxyUrl) {
1617
const sessionUuid = crypto.randomUUID()
1718

1819
const theSession = session.fromPartition(`potoken-${sessionUuid}`, { cache: false })
@@ -28,6 +29,12 @@ export async function generatePoToken(visitorData) {
2829
.join(' ')
2930
)
3031

32+
if (proxyUrl) {
33+
await theSession.setProxy({
34+
proxyRules: proxyUrl
35+
})
36+
}
37+
3138
const webContentsView = new WebContentsView({
3239
webPreferences: {
3340
backgroundThrottling: false,

src/renderer/components/ChannelDetails/ChannelDetails.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
240240
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
241241
import FtCard from '../ft-card/ft-card.vue'
242242
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
243-
import FtShareButton from '../ft-share-button/ft-share-button.vue'
243+
import FtShareButton from '../FtShareButton/FtShareButton.vue'
244244
import FtSubscribeButton from '../FtSubscribeButton/FtSubscribeButton.vue'
245245
import FtInput from '../ft-input/ft-input.vue'
246246

0 commit comments

Comments
 (0)