Refactor FF/Chrome differences
-
Use one global Chrome
context object to inject our shim over all Chrome functions, including the listener registration. Like the original Chrome object -
The Chrome
object queries for FF/Chrome in the beginning. -
Constructs its sub-objects according to FF/Chrome distinction -
Bonus points if it just delegates to native chrome object when it doesn't yet implement the required function/sub-object -
Change all call sites of the chrome object(s) and remove all instances of if (isFirefox)
-
Use in AddonOptions
, too -
usages in background.js
-
usages in TimeKeeper.js
-
Add storage.onChanged.addListener
-
and tabs.onUpdated.addListener
Edited by username-removed-678571