Then we should remove it in favor of having a button in your browser development tools. The fact that you want to have an "undocumented backdoor" tells you that it doesn't belong here.

(Also, it's just two lines of JS, that you can even combine into one, and use from a snippet or as a helper function in your app. There's no need to put development helpers in production APIs.)