Move initialization of offscreen proxy elements #668
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is intending to move all of the proxy stuff out of
Backend
directly and makes themain
function in charge of initialization. There are a few reasons behind this:Additionally, the prepare function of Offscreen hooksThis was referencing the wrong class.chrome.runtime.onMessage
, which should really be performed as soon as possible.Historically, there is some weirdness involving how the chrome events used to be hooked on the service worker after the transition from removing the background page in MV3. At least one of these events needs to be hooked without being deferred, otherwise the service worker can terminate immediately and never wake back up. I'm trying to think about how to better address this as well, since I have run into some issues that are not easy to solve due to the way the API hooking is deferred. Notably, the issue of the entire
API
not being able to be used until the service worker has been fully started, which can apparently take a non-trivial amount of time when large dictionaries have been installed.Draft for now as I work some stuff out.