Check whether a window is Popup or not?

前端 未结 10 1447
夕颜
夕颜 2020-12-08 20:23

This question is not the duplicate of if window is popup , But a similar one.

I am developing a extension which injects scripts to all web pages. I need to detect w

10条回答
  •  长情又很酷
    2020-12-08 20:46

    The following statement will be true if window is a popup window or subframe:

     window.parent != window
    

提交回复
热议问题