Skip to content

Move external player handling to the main process - #8416

Merged
FreeTubeBot merged 1 commit into
FreeTubeApp:developmentfrom
absidue:external-player-security
Dec 15, 2025
Merged

FreeTubeBot merged 1 commit into
FreeTubeApp:developmentfrom
absidue:external-player-security

Conversation

@absidue

@absidue absidue commented Dec 14, 2025

Copy link
Copy Markdown
Member

Pull Request Type

  • Security improvement

Description

This pull request moves the external player command construction to the main process, this allows us to add more validation and security checks to prevent abuse.

List of changes:

  • The IPC call only has a limited set of parameters such as the video ID, everything else that is needed is read from the external player map and settings in the main process.
  • Validation that the video ID and playlist ID are in the correct format and that other parameters have the correct datatypes and valid values.
  • Check that the external player setting is actually enabled.
  • Require the page that made the IPC call to be focused and the user to have recently interacted with the page.

Testing

Test that opening the external player by clicking on a button or with the default viewing mode set to external player still works correctly.

Try programmatically triggering the external player IPC call through the dev tools window.ftElectron.openInExternalPlayer({ videoID: '12345678911' }), it should do nothing/fail silently if you try it.

If you don't have an external player installed you can choose any one in the external player settings and replace lines 187 and 188 in src/main/externalPlayer.js with console.log(executable, args), you'll also need to uncomment line 75 in _scripts/dev-runner.js if you are running in dev mode.

Desktop

  • OS: Windows
  • OS Version: 11

@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Dec 14, 2025
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) December 14, 2025 13:17
@FreeTubeBot
FreeTubeBot merged commit 0307b82 into FreeTubeApp:development Dec 15, 2025
@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Dec 15, 2025
@absidue
absidue deleted the external-player-security branch December 15, 2025 23:17
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Dec 18, 2025
* development: (62 commits)
  Support exporting single playlists in YouTube's CSV format (FreeTubeApp#8430)
  Move external player handling to the main process (FreeTubeApp#8416)
  Revert "[Bug fix] Set max-block-size to prevent thin videos from passing the …" (FreeTubeApp#8418)
  Migrate the App component to the composition API (FreeTubeApp#8417)
  Bump electron-builder from 26.3.5 to 26.3.6 (FreeTubeApp#8422)
  Bump css-minimizer-webpack-plugin from 7.0.3 to 7.0.4 (FreeTubeApp#8428)
  Bump the eslint group with 3 updates (FreeTubeApp#8420)
  Bump sass from 1.94.2 to 1.96.0 (FreeTubeApp#8429)
  Bump vue-router from 4.6.3 to 4.6.4 (FreeTubeApp#8425)
  Bump peter-evans/create-pull-request from 7 to 8 (FreeTubeApp#8423)
  Bump mikefarah/yq from 4.49.2 to 4.50.1 (FreeTubeApp#8427)
  Bump lefthook from 2.0.8 to 2.0.11 (FreeTubeApp#8426)
  Bump electron from 39.2.6 to 39.2.7 (FreeTubeApp#8421)
  Bump actions/upload-artifact from 5 to 6 (FreeTubeApp#8424)
  Translated using Weblate (Russian)
  Translated using Weblate (Bulgarian)
  Translated using Weblate (German)
  Translated using Weblate (Indonesian)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (Japanese)
  ...
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Dec 21, 2025
* development: (62 commits)
  Support exporting single playlists in YouTube's CSV format (FreeTubeApp#8430)
  Move external player handling to the main process (FreeTubeApp#8416)
  Revert "[Bug fix] Set max-block-size to prevent thin videos from passing the …" (FreeTubeApp#8418)
  Migrate the App component to the composition API (FreeTubeApp#8417)
  Bump electron-builder from 26.3.5 to 26.3.6 (FreeTubeApp#8422)
  Bump css-minimizer-webpack-plugin from 7.0.3 to 7.0.4 (FreeTubeApp#8428)
  Bump the eslint group with 3 updates (FreeTubeApp#8420)
  Bump sass from 1.94.2 to 1.96.0 (FreeTubeApp#8429)
  Bump vue-router from 4.6.3 to 4.6.4 (FreeTubeApp#8425)
  Bump peter-evans/create-pull-request from 7 to 8 (FreeTubeApp#8423)
  Bump mikefarah/yq from 4.49.2 to 4.50.1 (FreeTubeApp#8427)
  Bump lefthook from 2.0.8 to 2.0.11 (FreeTubeApp#8426)
  Bump electron from 39.2.6 to 39.2.7 (FreeTubeApp#8421)
  Bump actions/upload-artifact from 5 to 6 (FreeTubeApp#8424)
  Translated using Weblate (Russian)
  Translated using Weblate (Bulgarian)
  Translated using Weblate (German)
  Translated using Weblate (Indonesian)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (Japanese)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants