Adding Automatically exit if the experiment is running on a mobile device

For my online experiment, I thought I should "
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
quitPsychoJS(‘Mobile device detected. Goodbye!’, false)
}

But when I tried to sync to pavlovia it is stuck at initialising so I am not sure if I add the code correctly.

I would appreciate any suggestion, thanks!

What is the error in the Browser console?

When I try the link in my phone At first I see this but then experiment starts.

When I try the link in my phone At first I see this but then experiment starts.