[core][js] merge webext2_fix: better init, mimetype for JSON loading, comments for JSHint