Repository navigation
a computer kept from an older image runs the box extension's new background script, so the page's focus is reported there too - #39
Merged
Conversation
…ground script, so the page's focus is reported there too
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The bug
After #38, a Bot's computer updated to the new image still never reported which box had focus. Bot A's fill on Facebook was refused with "the computer cannot say which box has focus": safe, but saved logins couldn't fill there at all.
A Bot's computer keeps its home volume, and with it the Chromium profile, across image updates. Chromium went on running the extension's background service worker that the profile had registered first:
Default/Service Worker/ScriptCacheon Bot A's computer held the oldbackground.js(nofocusByTab), dated before the update. A fresh profile held the new one. The content script ran and reported, but the old worker had no listener for it, sofocusnever reached the box.Bumping the extension's manifest
versiondid not make Chromium take the new script. That was tested and is not included here.The fix
docker/entrypoint.shgetsrefresh_extension_worker, called instart_chromebefore Chromium launches:/opt/box/active-tab/*and compares the result with${BOX_CHROME_PROFILE}/.box-active-tab.sha256.Default/Service Workeronce, then writes the stamp. Every worker registers anew: the extension's, and any a site had, which sites register again on their next visit.Tested (throwaway volume, never a Bot's)
grok-box:pre-focus).{"url":".../login.html","seq":3}, with nofocus. This reproduces the bug.focus.the box extension changed; clearing the profile's service workers once, then reported"focus":"password","seq":7after a Tab into the password box."focus":"password".bash -n docker/entrypoint.shpasses.