Document.oncontextmenu, component is not available (firefox)

Posted by Tom J Nowell on Stack Overflow See other posts from Stack Overflow or by Tom J Nowell
Published on 2010-01-05T18:13:56Z Indexed on 2010/04/15 9:03 UTC
Read the original article Hit count: 260

I have a script for a website, and one of the things ti does right at the end if attempt to disable an anti-right click protection in a website

if($("span[class=MembersNameDisplay]").exists()){
    var list_row = document.getElementsByTagName('script');
    if(list_row != null){
        list_row[0].parentNode.removeChild(list_row[0]);
    }
}

document.oncontextmenu=new Function("return true");

In google chrome this works, however in firefox with greasemonkey, the last line fails and the protection is not removed.

Error: Component is not available Line: 171

How do I fix this, and why does it fail under firefox?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about greasemonkey