I have a page that can be opened both by my own domain and externally, both as a "normal" window as a popup.
In this window, I need to check whether it has been opened as a popup or not, and perform some customizations programmatically. So far, I've been using the following approach (widely recommended):
if (window.opener)
// É um popup
else
// Não é um popup
However, I have found Compatibility issues with Internet Explorer , which causes the opener
attribute to not be filled.
Could anyone suggest an alternative to do this check?
Note:
- In general, I can not change the code that opens the window (eg to include querystring parameters)
- When I say open as a popup, I mean a call to
window.open()
.