Add custom variable for extra JS, and fixed the bug of unexpected comma in joining builtin JS codes and empty extra JS codes.