In Chrome & Firefox, it does not matter whether the popups are same origin as their openers. However, popup 1 cannot close the user-opened tab because that violates the rule above. Popup 2 can close popup 1 in this scenario. Imagine a scenario where there are two popups So in your specific example, the popup was opened by a script, but the opener was opened by a user, and therefore the opener cannot be closed by either itself or the popup. Scripts may only close windows were originally opened by script.The actual restriction you are probably running into is: If you read the quoted MDN text more carefully, it is actually referring to the opening of the parent, not the relationship to its popup. And yet they do allow the child to alter the location of the opener tab/window. Browsers typically don't allow a child tab/window to close its opener with script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |