omni
omni copied to clipboard
standardize use of arrow functions, scoped vars and for loops where possible, content.js
DO NOT MERGE WITHOUT CHECKING IF ALL FUNCTIONS WORK PLEASE It is important to test this commit as there is some changes that might break things.
This commit only affects the content.js, I have done the following
- Converted all function declarations to arrow functions where possible (some need for this var)
- Swapped all variables with scoped ones (es6) standard, helps with reducing bugs as well
- Converted where possible forEach loops to for (in) for readability and performance == to === as its safer to do a non loose equal, and we know we don't need loose
I was thinking about adding some tests to the code base, this would potentially help such refactors. I can give a try on the test setup, what do you think @alyssaxuu ?