Events
Microsoft 365 Community Conference
May 6, 2 PM - May 9, 12 AM
Skill up for the era of AI at the ultimate community-led Microsoft 365 event, May 6-8 in Las Vegas.
Learn moreThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Browsers prevent JavaScript from closing windows that aren’t owned by the script that calls
window.close
, so in many cases CloseButtonClosesWindow will not behave properly. In such cases an error may be logged on the browser developer console:
Scripts may close only the windows that were opened by it.
The calling script is not reliably given any information that the close()
call failed, so Office for the web can’t detect when this happens and change behavior. Thus, hosts who wish to close the current window when the Close UI is activated should prefer to use ClosePostMessage and handle the UI_Close
message for reliable close behavior.
Events
Microsoft 365 Community Conference
May 6, 2 PM - May 9, 12 AM
Skill up for the era of AI at the ultimate community-led Microsoft 365 event, May 6-8 in Las Vegas.
Learn more