0

If you run the following in Chrome console multiple times, it will update the same window over and over:

var win = window.open(`javascript:document.write(' <h1> Hello!!! </h1> ')`, 'test')

But how do we make it open a new window?

trusktr
  • 44,284
  • 53
  • 191
  • 263

1 Answers1

1

Use _blank property

like this :

var win = window.open(`javascript:document.write(' <h1> Hello!!! </h1> ')`, '_blank')
  • So obscure, thanks! It wasn't obvious because the first call opens a new window, so one may think that another call would also open another window. – trusktr Jun 05 '18 at 21:40