Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run arbitrary chromium-based flatpak browsers (Ungoogled Chromium) #2886

Open
Extarys opened this issue Sep 21, 2023 · 1 comment
Open

Run arbitrary chromium-based flatpak browsers (Ungoogled Chromium) #2886

Extarys opened this issue Sep 21, 2023 · 1 comment

Comments

@Extarys
Copy link

Extarys commented Sep 21, 2023

Is this a feature request or a bug?

Ability to run a third party flatpak such as UngoogledChromium

What is the current behavior?

Command:

"serve:chrome": "wait-on ./dist/manifest.json && web-ext run -t chromium --chromium-binary \"flatpak run com.github.Eloston.UngoogledChromium\" --start-url \"https://perdu.com\" --source-dir ./dist/",

I also tried playing with flatpak:com.github.Eloston.UngoogledChromium and gave it permission to /tmp directory through FlatSeal just in case.

Result:

node:events:492
      throw er; // Unhandled 'error' event
      ^

Error: spawn flatpak -- run com.github.Eloston.UngoogledChromium ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn flatpak -- run com.github.Eloston.UngoogledChromium',
  path: 'flatpak -- run com.github.Eloston.UngoogledChromium',
  spawnargs: [
    '--remote-debugging-port=43417',
    '--user-data-dir=/tmp/tmp-web-ext--37931-J2PLlwa2qYiq',
    '--disable-features=Translate',
    '--disable-component-extensions-with-background-pages',
    '--disable-background-networking',
    '--disable-component-update',
    '--disable-client-side-phishing-detection',
    '--disable-sync',
    '--metrics-recording-only',
    '--disable-default-apps',
    '--no-default-browser-check',
    '--no-first-run',
    '--disable-backgrounding-occluded-windows',
    '--disable-renderer-backgrounding',
    '--disable-background-timer-throttling',
    '--disable-ipc-flooding-protection',
    '--password-store=basic',
    '--use-mock-keychain',
    '--force-fieldtrials=*BackgroundTracing/default/',
    '--load-extension=/tmp/tmp-web-ext--37931-oxGlgzAakWJg/reload-manager-extension-1695305384803,/mnt/data/webext/x/dist',
    'https://google.com'
  ]
}

Node.js v18.17.1

What is the expected or desired behavior?

Ability to run arbitrary flatpak browsers (chromium based) for testing purposes. (Test V3 extension compatibility)

Version information (for bug reports)

  • Firefox version: 118.0
  • Your OS and version: Fedora 38
  • Paste the output of these commands:
node --version && npm --version && web-ext --version
v18.17.1
9.6.7
7.7.0

Similar to #2465

@rpl
Copy link
Member

rpl commented Sep 28, 2023

In #2477 we introduced support for handling a similar issue in flatpak packaged Firefox, by running it through flatpak run along with the --filesystem option passed, in theory something similar could be done for flatpak packaged Chromium too.

For chrome we don't launch it directly but we leave that to the chrome-launcher dependency and so I'd prefer to don't hack around that for this corner case, an alternative approach could be to write a small shell script which will be running the flatpak package Chromium through flatpak run and passint similar options to the ones we are passing to flapak packaged Firefox (which you can retrive by looking to the PR linked above) and pass the path to that shell script to the existing command line option to specify the path to the chromium executable.

@Extarys Would you mind to try out this workaround and report back to us if that worked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants