In js, you can't set window to null, which causes an error.
Perhaps you can turn off code prompts by setting the configuration