Picture of Henrik Aabom
Close extension does not work in Chrome
by Henrik Aabom - Monday, 19 June 2017, 1:20 PM
 

Hello fellow Adapteers

In the adapt-close extension:

https://github.com/cgkineo/adapt-close

the code: "top.window.close();" should close the window, but when running the code in Chrome I get the error:

"Scripts may close only the windows that were opened by it."

 

As far as I understand this, it is a Chrome thing to not allow for a window to be closed by a script unless the window has been opened by the script in the first place.

Firefos does the same, but Microsoft Edge and Internet Explorer 11 works fine.

Is there a way around this issue?

 

Thanks

Henrik

Picture of Matt Leathes
Re: Close extension does not work in Chrome
by Matt Leathes - Monday, 19 June 2017, 2:26 PM
 

Yes, that's right. Typically this extension would be used with a course that is launched in a new popup window from something like a learning management system.

I'm not aware of any workaround for this for situations when the course is not launched in this manner.

Picture of Henrik Aabom
Re: Close extension does not work in Chrome
by Henrik Aabom - Tuesday, 20 June 2017, 6:16 AM
 

Ok, thanks Matt

Tested this on SCORM Cloud and it works fine when the module is opened in a new window, as you say :)