Internal in a webview


I have a webview inside my app that I primarily use to access external websites.

One particular external website has some JS in its page:

newWin ="");
settimer = setInterval(counting, 500);
function counting() {
  if (newWin.closed) {
  } else {
    console.log('still open')

Since this website is opened inside a webview, the line doesn’t seem to actually open a page and thus the newWin variable cannot keep track of an opened page (the console of the webview says “Cannot read property ‘closed’ of null”)

**Question: How can I successfully allow my app to open a new window so that newWin can keep track of the new window is open or closed? **