Skip to content

perf: use global browser instead of webextension-polyfill#839

Merged
sidvishnoi merged 9 commits into
mainfrom
browser-lite
Oct 20, 2025
Merged

perf: use global browser instead of webextension-polyfill#839
sidvishnoi merged 9 commits into
mainfrom
browser-lite

Conversation

@sidvishnoi
Copy link
Copy Markdown
Member

@sidvishnoi sidvishnoi commented Jan 16, 2025

Context

We don't need the polyfill except for async message handlers in background.

Changes proposed in this pull request

Remove polyfilled browser from content scripts and React apps to reduce bundle size, and have less JS in content scripts (as they get injected into each frame in each tab) for better performance.

Keeping it draft until we add more E2E tests.

Zip size went down ~23KB only (duplication compresses better in zip). Unzipped size went 2.09MB from to 2.03MB (60KB).

Tested manually in Chrome, Firefox and Safari.

@github-actions github-actions Bot added area: content Improvements or additions to extension content script area: popup Improvements or additions to extension popup area: pages/app area: pages/notification area: pages Changes to any of extension's pages area: shared Changes to shared libraries and utilities labels Jan 16, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 16, 2025

Extension builds preview

Name Link
Latest commit d308222
Latest job logs Run #18647153751
Chrome (988.46KB)Download
Firefox (988.49KB)Download
Safari (1.91MB)Download

Copy link
Copy Markdown
Member Author

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

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

test-e2e

Copy link
Copy Markdown
Member Author

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

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

test-e2e

Copy link
Copy Markdown
Member Author

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

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

test-e2e

@sidvishnoi sidvishnoi marked this pull request as ready for review October 19, 2025 10:55
@sidvishnoi sidvishnoi requested a review from DarianM October 19, 2025 11:20
@sidvishnoi sidvishnoi merged commit 1d59f8e into main Oct 20, 2025
13 checks passed
@sidvishnoi sidvishnoi deleted the browser-lite branch October 20, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: content Improvements or additions to extension content script area: pages/app area: pages/notification area: pages Changes to any of extension's pages area: popup Improvements or additions to extension popup area: shared Changes to shared libraries and utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants