Add onLongRunningScript callback and stopJavaScript function