Currently, injected scripts run on the global scope, which means that multiple scripts with the same variable names on a single page can conflict. It also messes up LSPs when they find a similarly named variable from a different script that may not be injected.
I think that's probably a good way of dealing with that, although not a hugely important change (ideally each script is re-declaring the relevant variables anyway).
Currently, injected scripts run on the global scope, which means that multiple scripts with the same variable names on a single page can conflict. It also messes up LSPs when they find a similarly named variable from a different script that may not be injected.
The way I avoided this in #3 was to wrap everything necessary in its own scope with curly braces.
Would this be a good way to avoid variable name conflicts? Is it a good idea to do this for every other script?