Thank you very much for the contribution. I am sure this will benefit the Firefox users. From the code you have touched, I can see slightly a few code duplication, which can be refactored by extracting that to a function.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Thank you for your review, @justyy!
So far this week you've reviewed 4 contributions. Keep up the good work!
I haven't got much time to rewrite the whole block, and because I am not JavaScript or WebExtensions expert, I decided to concentrate on making the bug fix clear without additional refactoring.
The particular thing what is needed for refactoring is understanding the difference between
lastFocusedWindow
andcurrentWindow
flags when querying for tabs. Chrome current window docs mention thatcurrentWindow
is where the code is currently executing. I understand that when I click extension button on the toolbar, the code is executed in the window with the toolbar. Then I don't understand whylastFocusedWindow
is being used.