Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iframe permission error in FireFox #10

Open
adamflorin opened this issue Nov 20, 2012 · 1 comment
Open

iframe permission error in FireFox #10

adamflorin opened this issue Nov 20, 2012 · 1 comment

Comments

@adamflorin
Copy link

If the page contains an embedded iframe (e.g. the Vimeo iframe embed code below), Print Preview will fail in FireFox.

<iframe src="http://player.vimeo.com/video/9986699?byline=0&amp;portrait=0&amp;badge=0" width="500" height="375" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

The error in the FireFox console is Permission denied to access property 'name' when Print Preview tries to access window.frames[i].name (line 47 of jquery.print-preview.js).

I was able to make this more FireFox friendly in an ad hoc way by first checking the frames array. But there's probably a more elegant cross-platform solution. In the meantime:

        // The frame lives
        if (frames["print-frame"]) {
            var print_frame_ref = frames["print-frame"].document;
        } else {
            for (var i=0; i < window.frames.length; i++) {
                if (window.frames[i].name == "print-frame") {    
                    var print_frame_ref = window.frames[i].document;
                    break;
                }
            }
        }

Just FYI. Nice tool, thanks!

@josephwaiguru
Copy link

Hi i am processing payments using pesapal(has embedded iframe) but preview can't show.

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

No branches or pull requests

2 participants