[core][fr][js] merge webext2: code cleaning + bug fixes + remove Array comprehensions (for compatibility)