-
Notifications
You must be signed in to change notification settings - Fork 888
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
Fix #6372 Makes WebTorrent extension non-persistent #3638
Conversation
7bc3d1e
to
491dc3c
Compare
Fix #6372 Turning extension background to `persistent: false` allows browser to unload it when not in use. To avoid launching the extension on every page activity/tab switch/window switch needed to switch to using `webNavigation` events that can be filtered by URL patterns. Completely removed window event handling as no key functionality appears to depend on it. Removed most of tab events, only leaving `chrome.tabs.onRemoved` to keep torrent cleanup for now.
491dc3c
to
a609a71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM. No errors logged in the extension while doing a manual test.
Manual tests included downloading a .torrent file and clicking a magnet link. Both worked as expected in both possible scenarios (webtorrent on/off).
I would suggest this needs an issue with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, also tested on local and it worked as expected.
components/brave_webtorrent/extension/background/reducers/webtorrent_reducer.ts
Outdated
Show resolved
Hide resolved
CI is green already, labeled CI/skip for the incoming console log removal. |
Fix brave/brave-browser#6372
Turning extension background to
persistent: false
allows browser to unload it when not in use. To avoid launching the extension on every page activity/tab switch/window switch needed to switch to usingwebNavigation
events that can be filtered by URL patterns.Completely removed window event handling as no key functionality appears to depend on it.
Removed most of tab events, only leaving
chrome.tabs.onRemoved
to keep torrent cleanup for now.Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.