Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Edge browser javascript runtime "permission denied" error

The following code to open a calendar in popup window, works in all browsers but got "permission denied" error in Microsoft Edge browser.

popupWindow.document.writeln("<HTML>\n<TITLE>"+ title +"</TITLE>\n<link href='calendar.css' rel='stylesheet' type='text/css'>\n<HEAD>\n" + js + "</HEAD>");

The code before this:

popupWindow = window.open("","CAL1","toolbar=no,location=no,status=no,
    menubar=no,scrollbars=auto,resizable=no,alwaysRaised=no,dependent=yes,
    titlebar=no," + strDims + ",left=" + xoffset + ",top=" + yoffset );

Anybody knows why this is happening?

like image 795
Jing Avatar asked Jun 09 '15 21:06

Jing


People also ask

How do I run JavaScript in Microsoft edge?

Click the wrench icon on the toolbar. Click Options > Under the Hood. In the Privacy section, click Content settings. Scroll to the JavaScript section and click Allow all sites to run JavaScript (recommended).

What engine does Microsoft edge browser use to run JavaScript code?

Edge was the default browser for Windows 10. It was built with Microsoft's browser engine EdgeHTML and their Chakra JavaScript engine.

How do I allow blocked content in Microsoft edge?

Enabling mixed content in Microsoft EdgeClick the lock (caution) icon, then click Site Permissions. Scroll to Insecure content, then use the drop-down list to change “Block (default)” to “Allow”.


1 Answers

I think the problem here is the same origin policy. IE (and most likely Edge as well) probably considers a window opened with a '' (blank) URL as being in a different domain than the calling code. Try opening a blank HTML page for example instead of an empty URL.

like image 96
Stefan Gehrig Avatar answered Sep 20 '22 23:09

Stefan Gehrig