How can I open a pop-up window without it being blocked?

Florian Margaine

I haven't found a single answer able to tell me what's the right way to open a popup.

Times have changed, and popups have been mostly replaced with fancybox-like boxes. However, there are still times when popups are needed.

For those cases, I don't want my popup to be blocked by the browsers.

What's the right way to open a popup without it being blocked? Even if it opens a new tab in the browser. I just want my popup to be open, and have control of it from the parent or vice versa.

Stijn Hooft

Popup blockers will block any popup, unless it is opened because of an user action.

If the user clicks on a link, and a popup is opened in the click listener of that link, the popup blocker knows the user want to open something and will not (or should not) block the popup.

What you cannot do:

  • open a popup when the page is opened or closed
  • open a popup after a certain interval
  • open a popup after something asynchronous happens

What you can do:

  • open a popup in the on click listener
  • using target="_blank" in a anchor tag

You can access both windows with JavaScript variables:

  • if you use window.open, the parent can have a reference to the popup by assigning the result of window.open to a variable. Check out this article at W3Schools.
  • If the popup needs to have access to the window who has opened it, you can use window.opener. Check out this question.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I open a pop-up window without it being blocked?

From Dev

How to open a pop-up using JSF without it being blocked by the browser

From Dev

_blank got blocked as pop up how can i prevent this?

From Dev

How can I center the pop-up window on the screen?

From Dev

how to open a pop up window to a link in gridview

From Dev

How to open a webpage in a new window(Pop up)

From Dev

Twitter log in pop up window blocked

From Dev

simulate a mouse click hyperlink pop-up window is blocked, not open in tab

From Dev

Angularjs $window.open popups being blocked

From Dev

How can I programmatically open Powerpoint without seeing the window?

From Dev

As a user, how can I open a site in a popup window without toolbars?

From Dev

how to make window.open pop up Modal?

From Dev

How can I create pop up window that loads when you enter the site?

From Dev

How can I pop up the system property window in windows7

From Dev

the newly opened pop up window closes itself... how can I stop this?

From Dev

How can i make a pop-up window with checkboxes using javascript?

From Dev

how to create a VB script file without a pop up window

From Dev

How can I open a pop up of my JSF portlet's edit mode?

From Dev

Selenium open pop up window [Python]

From Dev

Open entity form in pop up window

From Dev

Open partial view in pop-up window

From Dev

Open entity form in pop up window

From Dev

how to focus pop up window?

From Dev

Selenium + Python - After clicking on a button, how to I catch the pop up window (specifically, an upload image pop up)

From Dev

jquery window.open in ajax success being blocked

From Dev

How can I get the django allauth signup page to show up without being at the /accounts/login url?

From Dev

How can I create a pop-up window using Cocos2d, SpriteBuilder and Objective-c?

From Dev

How can I create a pop-up window in Shiny to warn user about selecting one type of file extension?

From Dev

How can I have a new window open up after okay is pressed?

Related Related

  1. 1

    How can I open a pop-up window without it being blocked?

  2. 2

    How to open a pop-up using JSF without it being blocked by the browser

  3. 3

    _blank got blocked as pop up how can i prevent this?

  4. 4

    How can I center the pop-up window on the screen?

  5. 5

    how to open a pop up window to a link in gridview

  6. 6

    How to open a webpage in a new window(Pop up)

  7. 7

    Twitter log in pop up window blocked

  8. 8

    simulate a mouse click hyperlink pop-up window is blocked, not open in tab

  9. 9

    Angularjs $window.open popups being blocked

  10. 10

    How can I programmatically open Powerpoint without seeing the window?

  11. 11

    As a user, how can I open a site in a popup window without toolbars?

  12. 12

    how to make window.open pop up Modal?

  13. 13

    How can I create pop up window that loads when you enter the site?

  14. 14

    How can I pop up the system property window in windows7

  15. 15

    the newly opened pop up window closes itself... how can I stop this?

  16. 16

    How can i make a pop-up window with checkboxes using javascript?

  17. 17

    how to create a VB script file without a pop up window

  18. 18

    How can I open a pop up of my JSF portlet's edit mode?

  19. 19

    Selenium open pop up window [Python]

  20. 20

    Open entity form in pop up window

  21. 21

    Open partial view in pop-up window

  22. 22

    Open entity form in pop up window

  23. 23

    how to focus pop up window?

  24. 24

    Selenium + Python - After clicking on a button, how to I catch the pop up window (specifically, an upload image pop up)

  25. 25

    jquery window.open in ajax success being blocked

  26. 26

    How can I get the django allauth signup page to show up without being at the /accounts/login url?

  27. 27

    How can I create a pop-up window using Cocos2d, SpriteBuilder and Objective-c?

  28. 28

    How can I create a pop-up window in Shiny to warn user about selecting one type of file extension?

  29. 29

    How can I have a new window open up after okay is pressed?

HotTag

Archive