Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

FancyBox Permission Denied Microsoft Edge #1155

Closed
Jackk1337 opened this issue Oct 24, 2016 · 17 comments
Closed

FancyBox Permission Denied Microsoft Edge #1155

Jackk1337 opened this issue Oct 24, 2016 · 17 comments

Comments

@Jackk1337
Copy link

Hey guys,

Using FancyBox with edge results with a SCRIPT70: Permission denied when trying to close a popup. Also inserting the code manually into the browsers console 'parent.jQuery.fancybox.close();' also results in a Permission Denied.

@fancyapps
Copy link
Owner

Could you show your page?

@Jackk1337
Copy link
Author

Here's an example of the popup box:
http://imgur.com/Dxa8xD5

After clicking submit the popup will not close, we get a permission denied but ONLY in Edge.
http://imgur.com/Dxa8xD5

Also we cannot cross of the popup box, same issue. Also we can't manually put the javascript close into the Edge console. Same error everytime.

Thanks

@fancyapps
Copy link
Owner

I wanted to see your actual page, not just screens :) Because I can not replicate your scenario.
Are you using ajax/iframes? Maybe you are experiencing cross-domain problem.

@Jackk1337
Copy link
Author

Hi,

I can't show the page as it is an internal network website. The website uses iFrames to display FancyBox. Also this happens only in Edge. The examples work fine which are included with fancybox.

Our setup is pretty simple. The fancybox loads a form which we can enter data in. When you click Submit it runs simple PHP to enter the data into the database. At this point everything becomes Permission denied when trying to close the popup.

Thanks

@fancyapps
Copy link
Owner

Actually, IE has that issue for a long time, try googling "jQuery IE Access denied error".
What jQuery version are you using? Try updating. And make sure your iframed page is on the same domain.

@Jackk1337
Copy link
Author

Hi,

It's weird because IE works fine (Aside from the page doesn't look right in IE) but the fancybox will work fine.

We're using jquery-1.10.1.min.js which is included with fancybox

Thanks

@fancyapps
Copy link
Owner

Try updating to latest jQuery 1.x from https://code.jquery.com/

@Jackk1337
Copy link
Author

Hi,

Switched over to 1.12.4 but still no look. Even putting
javascript:parent.jQuery.fancybox.close();

Into the Edge console results in a permission denied. This only happens after the submit button has been pressed. Weird.

Thanks

@fancyapps
Copy link
Owner

Any luck?

@fancyapps
Copy link
Owner

I tried to recreate this, but worked fine for me.

@mullummer
Copy link

I have the same problem. It only happens after I perform a POST of a form inside the iFrame.
It is an EDGE problem only. IE11 doesn't have this problem

@fancyapps
Copy link
Owner

If you are posting to "" (e.g., <form action=""...>), then try changing to full url.
What jQuery version are you using?

@mullummer
Copy link

Using full url didn't help.
Using method "GET" didn't help

jquery 1.10.1

@fancyapps
Copy link
Owner

This post suggests that this has been fixed in the last stable version of Edge - http://stackoverflow.com/questions/34643687/getting-script70-permission-denied-only-with-edge-browser-javascript-error

Maybe I can not reproduce this issue, because I have the latest (Microsoft Edge 38.14393.0.0 / Microsoft EdgeHTML 14.14393). What version are you using?

@mullummer
Copy link

mullummer commented Mar 6, 2017

That is also the version I am testing on.
Tried http:// too, but same result.
It also happens when I navigate away from the iframe page using a hyperlink (to an image on the same website). Navigation is OK, but closing it afterwards results in the permission denied error

It seems more like an Edge issue than a script issue to me. I am thinking about solving it with an AJAX call

ps, I use the click() workaround to open the fancybox, but that should not make any difference I assume

function magic_fancy(trans,PARAM1,PARAM2,PARAM3) {
var appname = $('#Appname').val();
url = requester + '?appname=' + appname + '&prgname=START&transaction=' + trans + '&PARAM1=' + escape(PARAM1) + '&PARAM2=' + escape(PARAM2) + '&PARAM3=' + escape(PARAM3);

if($('#fancybox').length == 0) {
	$('body').append('<a id="fancybox" class="hide"></a>');
	$('#fancybox').fancybox({
		'overlayShow': true,
		'type': 'iframe'
	})
}
$('#fancybox').attr('href',url);
$('#fancybox').click();

}

@fancyapps
Copy link
Owner

Have you tried updating to the most recent version of jQuery? This looks like a nasty IE/Edge issue and jQuery included some workarounds jquery/sizzle@28f4c67

Also, why are you using such a weird hack? I have seen it multiple times, but I do not know where does it come from. You can just use $.fancybox.open method, see documentation for examples.

@mullummer
Copy link

mullummer commented Mar 6, 2017

That solved it

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

I hadn't tried it because it didn't help the person above. I'll probably run into other problems unrelated to fancybox, but thanks for the help!

(Not sure why I used that workaround to open boxes. It is from a long time ago)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants