Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ie9: annoying pops-up while debugging: "Error: '__flash__removeCallback' is undefined"

I am working on a asp.net mvc site that uses facebook social widgets. Whenever I launch the debugger (ie9 is the browser) I get many error popups with: Error: '__flash__removeCallback' is undefined.

To verify that my code was not responsible I just created a brand new asp.net mvc site and hit F5. If you navigate to this url: http://developers.facebook.com/docs/guides/web/#plugins you will see the pop-ups appearing.

When using other browsers the pop-up does not appear. I had been using the latest ie9 beta before updating to ie9 RTM yesterday and had not run into this issue.

As you can imagine it is extremely annoying... How can I stop those popups? Can someone else reproduce this?

Thank you!

like image 497
santiagoIT Avatar asked Oct 11 '22 12:10

santiagoIT


2 Answers

I can't seem to solve this either, but I can at least hide it for my users:

$('#video iframe').attr('src', '').hide();
try {
    $('#video').remove();
} catch(ex) {}

The first line prevents the issue from screwing up the page; the second eats the error when jquery removes it from the DOM explicitly. In my case I was replacing the HTML of a container several parents above this tag and exposing this exception to the user until this fix.

like image 57
Chris Moschini Avatar answered Nov 09 '22 10:11

Chris Moschini


I'm answering this as this drove me up the wall today.

It's caused by flash, usually when you haven't put a unique id on your embed object so it selects the wrong element.

The quickest (and best) way to solve this is to just:

add a UNIQUE id to your embed/object

Now this doesn't always seem to solve it, I had one site where it just would not go away no matter what elements I set the id on (I suspect it was the video player I was asked to use by the client).

This javascript code (using jQuery's on document load, replace with your favourite alternative) will get rid of it. Now this obviously won't remove the callback on certain elements. They must want to remove it for a reason, perhaps it will lead to a gradual memory leak on your site in javascript, but it's probably trivial.

this is a secondary (and non-optimal) solution

    $(function () {
        setTimeout(function () {
            if (typeof __flash__removeCallback != "undefined") {
                __flash__removeCallback = __flash__removeCallback__replace;
            } else {
                setTimeout(arguments.callee, 50);
            }
        }, 50);
    });

    function __flash__removeCallback__replace(instance, name) {
        if(instance != null)
            instance[name] = null;
    }
like image 23
mattmanser Avatar answered Nov 09 '22 12:11

mattmanser