Skip to content

Commit 727b7a9

Browse files
committed
Merge branch 'development' into feature/4497-hide-watched-videos
* development: (50 commits) add rules to issue templates (FreeTubeApp#7516) Translated using Weblate (Romanian) Translated using Weblate (Serbian) Translated using Weblate (Russian) Move settings to `more` menu on smaller mobile devices (FreeTubeApp#7506) Translated using Weblate (Russian) Migrate WatchVideoLiveChat to the composition API (FreeTubeApp#7494) Translated using Weblate (Basque) Translated using Weblate (Russian) Bump shaka-player from 4.14.14 to 4.14.15 (FreeTubeApp#7501) Bump electron from 36.3.1 to 36.3.2 (FreeTubeApp#7500) Bump sass from 1.89.0 to 1.89.1 (FreeTubeApp#7499) Bump the eslint group with 3 updates (FreeTubeApp#7498) Bump the stylelint group with 2 updates (FreeTubeApp#7497) Bump @babel/core from 7.27.1 to 7.27.4 in the babel group (FreeTubeApp#7496) Translated using Weblate (Japanese) Translated using Weblate (German) Implement context menu item "search X in new window" (FreeTubeApp#7477) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (French) ... # Conflicts: # static/locales/da.yaml
2 parents f49bbe9 + d9f6484 commit 727b7a9

File tree

75 files changed

+2144
-1799
lines changed

Some content is hidden

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

75 files changed

+2144
-1799
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ body:
2323
required: true
2424
- label: This issue contains only one bug.
2525
required: true
26+
- label: I have read and agree to follow the [rules](https://docs.freetubeapp.io/community/rules/).
27+
required: true
2628
- type: textarea
2729
attributes:
2830
label: Describe the bug

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ body:
1919
required: true
2020
- label: This issue contains only one feature request.
2121
required: true
22+
- label: I have read and agree to follow the [rules](https://docs.freetubeapp.io/community/rules/).
23+
required: true
2224
- type: textarea
2325
attributes:
2426
label: Problem Description
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
const os = require('os')
2-
const builder = require('electron-builder')
3-
const config = require('./ebuilder.config.js')
1+
import { Arch, build, Platform } from 'electron-builder'
2+
import config from './ebuilder.config.mjs'
43

5-
const Platform = builder.Platform
6-
const Arch = builder.Arch
74
const args = process.argv
85

96
/** @type {Map<import('electron-builder').Platform, Map<import('electron-builder').Arch, Array<string>>>} */
107
let targets
11-
const platform = os.platform()
8+
const platform = process.platform
129

1310
if (platform === 'darwin') {
1411
let arch = Arch.x64
@@ -40,15 +37,9 @@ if (platform === 'darwin') {
4037
targets = Platform.LINUX.createTarget(['deb', 'zip', '7z', 'rpm', 'AppImage', 'pacman'], arch)
4138
}
4239

43-
builder
44-
.build({
45-
targets,
46-
config,
47-
publish: 'never'
48-
})
49-
.then(m => {
50-
console.log(m)
51-
})
52-
.catch(e => {
53-
console.error(e)
54-
})
40+
try {
41+
const output = await build({ targets, config, publish: 'never' })
42+
console.log(output)
43+
} catch (error) {
44+
console.error(error)
45+
}

_scripts/dev-runner.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ const web = process.argv.indexOf('--web') !== -1
1818

1919
let mainConfig
2020
let rendererConfig
21+
let preloadConfig
2122
let botGuardScriptConfig
2223
let webConfig
2324
let SHAKA_LOCALES_TO_BE_BUNDLED
2425

2526
if (!web) {
2627
mainConfig = require('./webpack.main.config')
2728
rendererConfig = require('./webpack.renderer.config')
29+
preloadConfig = require('./webpack.preload.config.js')
2830
botGuardScriptConfig = require('./webpack.botGuardScript.config')
2931

3032
SHAKA_LOCALES_TO_BE_BUNDLED = rendererConfig.SHAKA_LOCALES_TO_BE_BUNDLED
@@ -132,6 +134,36 @@ function startMain() {
132134
})
133135
}
134136

137+
function startPreload() {
138+
const compiler = webpack(preloadConfig)
139+
const { name } = compiler
140+
141+
let firstTime = true
142+
143+
compiler.hooks.afterEmit.tap('afterEmit', async () => {
144+
console.log(`\nCompiled ${name} script!`)
145+
146+
if (firstTime) {
147+
firstTime = false
148+
} else {
149+
manualRestart = true
150+
await restartElectron()
151+
setTimeout(() => {
152+
manualRestart = false
153+
}, 2500)
154+
}
155+
156+
console.log(`\nWatching file changes for ${name} script...`)
157+
})
158+
159+
compiler.watch({
160+
aggregateTimeout: 500,
161+
},
162+
err => {
163+
if (err) console.error(err)
164+
})
165+
}
166+
135167
function startRenderer(callback) {
136168
const compiler = webpack(rendererConfig)
137169
const { name } = compiler
@@ -208,6 +240,7 @@ function startWeb () {
208240
if (!web) {
209241
startRenderer(() => {
210242
startBotGuardScript()
243+
startPreload()
211244
startMain()
212245
})
213246
} else {
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
const { name, productName } = require('../package.json')
1+
import packageDetails from '../package.json' with { type: 'json' }
22

33
/** @type {import('electron-builder').Configuration} */
4-
const config = {
5-
appId: `io.freetubeapp.${name}`,
4+
export default {
5+
appId: `io.freetubeapp.${packageDetails.name}`,
66
copyright: 'Copyleft © 2020-2025 freetubeapp@protonmail.com',
77
// asar: false,
88
// compression: 'store',
9-
productName,
9+
productName: packageDetails.productName,
1010
directories: {
1111
output: './build/',
1212
},
@@ -96,5 +96,3 @@ const config = {
9696
oneClick: false,
9797
},
9898
}
99-
100-
module.exports = config

_scripts/injectAllowedPaths.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const paths = readdirSync(distDirectory, {
2121
// disallow the renderer process/browser windows to read the main.js file
2222
dirent.name !== 'main.js' &&
2323
dirent.name !== 'main.js.LICENSE.txt' &&
24+
// disallow the renderer process/browser windows to read the preload.js file
25+
dirent.name !== 'preload.js' &&
2426
// disallow the renderer process/browser windows to read the botGuardScript.js file
2527
dirent.name !== 'botGuardScript.js' &&
2628
// filter out any web build files, in case the dist directory contains a web build

_scripts/webpack.preload.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const path = require('path')
2+
3+
const isDevMode = process.env.NODE_ENV === 'development'
4+
5+
/** @type {import('webpack').Configuration} */
6+
const config = {
7+
name: 'preload',
8+
mode: process.env.NODE_ENV,
9+
devtool: isDevMode ? 'eval-cheap-module-source-map' : false,
10+
entry: {
11+
preload: path.join(__dirname, '../src/preload/main.js'),
12+
},
13+
infrastructureLogging: {
14+
// Only warnings and errors
15+
// level: 'none' disable logging
16+
// Please read https://webpack.js.org/configuration/other-options/#infrastructurelogginglevel
17+
level: isDevMode ? 'info' : 'none'
18+
},
19+
output: {
20+
path: path.join(__dirname, '../dist'),
21+
filename: '[name].js'
22+
},
23+
externals: [
24+
'electron/renderer'
25+
],
26+
externalsType: 'commonjs',
27+
node: {
28+
__dirname: false,
29+
__filename: false
30+
},
31+
target: 'electron-preload',
32+
}
33+
34+
module.exports = config

_scripts/webpack.renderer.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const config = {
3939
level: isDevMode ? 'info' : 'none'
4040
},
4141
output: {
42-
libraryTarget: 'commonjs2',
42+
scriptType: 'text/javascript',
4343
path: path.join(__dirname, '../dist'),
4444
filename: '[name].js',
4545
},
@@ -191,7 +191,7 @@ const config = {
191191
},
192192
extensions: ['.js', '.vue']
193193
},
194-
target: 'electron-renderer',
194+
target: 'web',
195195
}
196196

197197
if (isDevMode) {

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"build": "run-s patch-shaka pack build-release",
2323
"build:arm64": "run-s patch-shaka pack build-release:arm64",
2424
"build:arm32": "run-s patch-shaka pack build-release:arm32",
25-
"build-release": "node _scripts/build.js",
26-
"build-release:arm64": "node _scripts/build.js arm64",
27-
"build-release:arm32": "node _scripts/build.js arm32",
25+
"build-release": "node _scripts/build.mjs",
26+
"build-release:arm64": "node _scripts/build.mjs arm64",
27+
"build-release:arm32": "node _scripts/build.mjs arm32",
2828
"clean": "node _scripts/clean.mjs",
2929
"debug": "run-s patch-shaka debug-runner",
3030
"debug-runner": "node _scripts/dev-runner.js --remote-debug",
@@ -43,13 +43,13 @@
4343
"lint-style": "stylelint \"src/**/*.{css,scss}\"",
4444
"lint-style-fix": "stylelint --fix \"src/**/*.{css,scss}\"",
4545
"lint-yml": "eslint --config eslint.config.mjs \"**/*.yml\" \"**/*.yaml\"",
46-
"pack": "run-p pack:main pack:renderer pack:botGuardScript && node _scripts/injectAllowedPaths.mjs",
46+
"pack": "run-p pack:main pack:renderer pack:preload pack:botGuardScript && node _scripts/injectAllowedPaths.mjs",
4747
"pack:main": "webpack --mode=production --node-env=production --config _scripts/webpack.main.config.js",
4848
"pack:renderer": "webpack --mode=production --node-env=production --config _scripts/webpack.renderer.config.js",
49+
"pack:preload": "webpack --mode=production --node-env=production --config _scripts/webpack.preload.config.js",
4950
"pack:web": "webpack --mode=production --node-env=production --config _scripts/webpack.web.config.js",
5051
"pack:botGuardScript": "webpack --config _scripts/webpack.botGuardScript.config.js",
51-
"postinstall": "run-s --silent patch-shaka",
52-
"release": "run-s test build",
52+
"postinstall": "yarn run --silent patch-shaka",
5353
"ci": "yarn install --silent --frozen-lockfile --network-concurrency 1"
5454
},
5555
"dependencies": {
@@ -65,7 +65,7 @@
6565
"marked": "^15.0.12",
6666
"portal-vue": "^2.1.7",
6767
"process": "^0.11.10",
68-
"shaka-player": "^4.14.14",
68+
"shaka-player": "^4.14.15",
6969
"swiper": "^11.2.8",
7070
"vue": "^2.7.16",
7171
"vue-i18n": "^8.28.2",
@@ -75,20 +75,20 @@
7575
"youtubei.js": "^13.4.0"
7676
},
7777
"devDependencies": {
78-
"@babel/core": "^7.27.1",
78+
"@babel/core": "^7.27.4",
7979
"@babel/plugin-transform-class-properties": "^7.27.1",
8080
"@babel/preset-env": "^7.27.2",
8181
"@double-great/stylelint-a11y": "^3.0.4",
82-
"@eslint/js": "^9.27.0",
82+
"@eslint/js": "^9.28.0",
8383
"@intlify/eslint-plugin-vue-i18n": "^3.2.0",
8484
"babel-loader": "^10.0.0",
8585
"copy-webpack-plugin": "^13.0.0",
8686
"css-loader": "^7.1.2",
8787
"css-minimizer-webpack-plugin": "^7.0.2",
88-
"electron": "^36.3.1",
88+
"electron": "^36.3.2",
8989
"electron-builder": "^26.0.15",
90-
"eslint": "^9.27.0",
91-
"eslint-plugin-jsdoc": "^50.6.17",
90+
"eslint": "^9.28.0",
91+
"eslint-plugin-jsdoc": "^50.7.1",
9292
"eslint-plugin-jsonc": "^2.20.1",
9393
"eslint-plugin-unicorn": "^59.0.1",
9494
"eslint-plugin-vue": "^10.1.0",
@@ -102,11 +102,11 @@
102102
"mini-css-extract-plugin": "^2.9.2",
103103
"neostandard": "^0.12.1",
104104
"npm-run-all2": "^8.0.4",
105-
"postcss": "^8.5.3",
105+
"postcss": "^8.5.4",
106106
"postcss-scss": "^4.0.9",
107-
"sass": "^1.89.0",
107+
"sass": "^1.89.1",
108108
"sass-loader": "^16.0.5",
109-
"stylelint": "^16.19.1",
109+
"stylelint": "^16.20.0",
110110
"stylelint-config-sass-guidelines": "^12.1.0",
111111
"stylelint-config-standard": "^38.0.0",
112112
"stylelint-high-performance-animation": "^1.11.0",

src/constants.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ const IpcChannels = {
1212
APP_READY: 'app-ready',
1313
RELAUNCH_REQUEST: 'relaunch-request',
1414

15-
REQUEST_FULLSCREEN: 'request-fullscreen',
16-
REQUEST_PIP: 'request-pip',
17-
1815
SEARCH_INPUT_HANDLING_READY: 'search-input-handling-ready',
1916
UPDATE_SEARCH_INPUT_TEXT: 'update-search-input-text',
2017

@@ -190,12 +187,16 @@ const KeyboardShortcuts = {
190187
SMALL_REWIND: 'arrowleft',
191188
SMALL_FAST_FORWARD: 'arrowright',
192189
DECREASE_VIDEO_SPEED: 'o',
190+
DECREASE_VIDEO_SPEED_ALT: '<',
193191
INCREASE_VIDEO_SPEED: 'p',
192+
INCREASE_VIDEO_SPEED_ALT: '>',
194193
SKIP_N_TENTHS: '0..9',
195194
LAST_CHAPTER: 'ctrl+arrowleft',
196195
NEXT_CHAPTER: 'ctrl+arrowright',
197196
LAST_FRAME: ',',
198197
NEXT_FRAME: '.',
198+
HOME: 'home',
199+
END: 'end',
199200
}
200201
},
201202
}

0 commit comments

Comments
 (0)