This snippet check if the current page is in a iframe. The code works well in normal navigation mode but not in incognito mode on Chrome when domains of parent page and iframe are different (ex: localhost and localhost1). In incognito mode always show 'NORMAL' alert message.
if( window.top === window.self){
alert('NORMAL')
} else {
alert('IFRAME')
}
How can I make it work in incognito mode?