How can I prevent Chrome console giving the following error when I try to use the prompt() command?

> 
> A window.prompt() dialog generated by this page was suppressed because
>  this page is not the active tab of the front window. Please make sure
>  your dialogs are triggered by user interactions to avoid this
>  situation. <https://www.chromestatus.com/feature/5637107137642496>
> 
> 
> 

Up until 2-3 days ago the prompt() command worked fine and would open a dialog where I could input data, now it always gives me this error even if I am definitely on the active tab. I have checked chrome content settings and allow popups is checked.

Thanks!