Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari JavaScript Console Not Executing JS Or Showing Output On Certain Pages

I've encountered a Safari-specific JS issue in a page I'm locally developing, so I need to use the Safari Web Inspector.

In Safari Version 13.1.1, when I open the inspector and select Develop > Show JavaScript Console and start entering JavaScript, I don't get any output and the JavaScript is not executed (e.g. an alert does not fire).

picture of 2+2;, alert('okay!');, var myvar = 'foo'; in blue with no output

On any other page, the safari JS console works just fine for me. Here's an example of normal behavior, on stackoverflow.com:

picture of 2+2; with 4 output

Note: the Safari JS console on other locally developed pages are working just fine.

What could possibly be causing this?

like image 845
Myer Avatar asked Oct 07 '20 21:10

Myer


1 Answers

As other users mentioned, opening the page in a new tab fixes this, but you can also just close the Javascript console (clicking the 'x' in the console window) and re-open it.

like image 155
cc. Avatar answered Oct 13 '22 09:10

cc.