extract js from main