Skip to content

Conversation

@aklinker1
Copy link
Member

@aklinker1 aklinker1 commented Jun 2, 2025

Overview

web-ext has few problems:

  1. ~20MB install footprint (20% of WXT's total install footprint, even after using my lighter fork, web-ext-run)
  2. Relies on --load-extension, which has been deprecated (there are plans to upgrade to using the CDP
  3. A little slower (see ./scripts/benchmarks/browser-startup.sh)
    Package Time to open browser (mean, N=20)
    web-ext 634ms
    @wxt-dev/runner 594ms

TODO

  • Can you connect a remote debugger to it?

Manual Testing

cd pacakges/wxt-demo
pnpm dev

This should open your browser.

Related Issue

N/A

@aklinker1 aklinker1 requested a review from Timeraa as a code owner June 2, 2025 21:59
@aklinker1 aklinker1 self-assigned this Jun 2, 2025
@netlify
Copy link

netlify bot commented Jun 2, 2025

Deploy Preview for creative-fairy-df92c4 failed.

Name Link
🔨 Latest commit ebdd01c
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/683e253adf27e90008b3c3e6

@aklinker1 aklinker1 added the chore label Jun 2, 2025
@aklinker1 aklinker1 marked this pull request as draft June 2, 2025 21:59
Comment on lines +10 to +14
if (wxt.config.browser === 'firefox' && wxt.config.manifestVersion === 3) {
throw Error(
'Dev mode does not support Firefox MV3. For alternatives, see https://github.com/wxt-dev/wxt/issues/230#issuecomment-1806881653',
);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: Extract to own PR.


const debugBidi = debug.scoped('bidi');

export interface BidiConnection extends Disposable {
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: Extract disposable changes to own PR.

DEFAULT_CHROMIUM_PREFS,
),
args: [
'--unsafely-disable-devtools-self-xss-warnings',
Copy link
Member Author

@aklinker1 aklinker1 Jun 2, 2025

Choose a reason for hiding this comment

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

TODO: Add this flag?

3481313

@PatrykKuniczak
Copy link
Collaborator

This could also fix #137
If you are able to implement feature for this, in your package :)

@aklinker1
Copy link
Member Author

This could also fix #137

If you are able to implement feature for this, in your package :)

Nope, not something I can implement for the same reasons mentioned in the issue.

@PatrykKuniczak
Copy link
Collaborator

@aklinker1 If you've decided to back to using web-ext this PR still have sense?
Or web-ext is better than web-ext-run but anyway in the future, you want to avoid using it?

@aklinker1
Copy link
Member Author

I realized there was a better way to eventually add support for this while I continue developing it - hence #2078 and the accompanying PR. We don't need to hard-cut over like this PR originally did, this package isn't a full replacement for web-ext and may never be.

This PR needs changed to support @wxt-dev/runner as a peer similar to what I did to web-ext in #2079. specifically just add another try/catch statement and dynamic import for @wxt-dev/runner to let people use it over web-ext.

try {
// This module imports `web-ext`, so if it fails, we know `web-ext` isn't installed
const { createWebExtRunner } = await import('./runners/web-ext');
return mergedConfig.webExt?.disabled
? createManualRunner()
: createWebExtRunner();
} catch (err: any) {
if (err?.code !== 'ERR_MODULE_NOT_FOUND') throw err;
console.log('error', err);
logger.debug('Error loading the web-ext runner', err);
}

The goal with this package is to be a super light-weight, zero dependency alternative to web-ext, which is quite heavy.

It probably will never support all the features of web-ext or replace it, but for people that like smaller node_modules (like me), web-ext is just too big for what WXT needs it to do.

@PatrykKuniczak
Copy link
Collaborator

@aklinker1 I don't want to open new thread for this, but i want to know.
Are you able to reduce amount of branches, or you'll be working on it someday or you've archived it on purpose?

@aklinker1
Copy link
Member Author

The 36 branches? I could clean them up if it's bothering you.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants