mode switch for node webkit