-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Improve startup #2438
Improve startup #2438
Conversation
src/js/webrequest.js
Outdated
* @returns {Object} | ||
*/ | ||
function onBeforeReady(details) { | ||
if (!pendingTabs || details.tabId < 0) { |
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.
when would pendingTabs be falsey here?
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.
We set pendingTabs
to null
at the end of reloadPendingTabs()
. Is it possible to still have requests queued for onBeforeReady()
after stopBeforeReadyListener()
is called? I would have to look into it.
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.
We may want to ignore "main_frame" resources to avoid running into gorhill/uBlock#3130
src/js/webrequest.js
Outdated
} | ||
|
||
function stopBeforeReadyListener() { | ||
chrome.webRequest.onBeforeRequest.removeListener(onBeforeReady); |
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.
Should the listener not be removed for it to be treated as "persistent" by Firefox? See uBlockOrigin/uBlock-issues#128 (comment)
4b92622
to
47dbaba
Compare
0de95d8
to
74d2ec9
Compare
Conflicts: src/js/background.js
74d2ec9
to
91c5f26
Compare
Called in a loop on (seed) data import.
Removes a getBaseDomain() call from a loop.
Related to #1845.
badger.INITIALIZED
to account for asynchronous initialization tasks (such as seed data loading). This removes the need for workarounds in places that care about Badger being fully initialized (might want to keep them though in badger-sett for a while longer to enable running with Badgers that won't have this fix).Sets up an earlychrome.onBeforeRequest
listener to cancel all requests before Badger is done initializing. Reloads the tabs for the cancelled requests upon Badger being ready. (fb68766, 0de95d8) This should be guaranteed to catch all requests on startup in Firefox thanks to a "persistent" listener, and should catch more requests on startup in Chrome thanks to initializing a blocking listener faster.