The getTab, getCurrentTab, etc logic was quite confused. Let's tidy that up as
best we can for now:
Remove the unused getTab and getCurrentTab message handlers.
Remove the unused and outdated utils.getCurrentURL function.
Remove the unused callback parameter from utils.getCurrentTab and add a
JSDoc comment for the function.
Move the logic for getting a Tab Object for the currently focused tab into
the TabManager class.
Note the current tab ID in session storage (in memory), so that the current
tab can (usually) be determined even when the developer tools or popup UI are
open.
Reviewer: @sammacbeth
Description:
Steps to test this PR:
Automated tests:
[ ] Unit tests
[ ] Integration tests
Reviewer Checklist:
[ ] Ensure the PR solves the problem
[ ] Review every line of code
[ ] Ensure the PR does no harm by testing the changes thoroughly
[ ] Get help if you're uncomfortable with any of the above!
[ ] Determine if there are any quick wins that improve the implementation
PR Author Checklist:
[ ] Get advice or leverage existing code
[ ] Agree on technical approach with reviewer (if the changes are nuanced)
[ ] Ensure that there is a testing strategy (and documented non-automated tests)
[ ] Ensure there is a documented monitoring strategy (if necessary)
The getTab, getCurrentTab, etc logic was quite confused. Let's tidy that up as best we can for now:
getTab
andgetCurrentTab
message handlers.utils.getCurrentURL
function.callback
parameter fromutils.getCurrentTab
and add a JSDoc comment for the function.Reviewer: @sammacbeth
Description:
Steps to test this PR:
Automated tests:
Reviewer Checklist:
PR Author Checklist: