2010-01-05 69 views
1

我有一個網站的腳本,以及TI就在年底做,如果試圖禁用網站的抗右擊保護的事情之一Document.oncontextmenu,組件不可用(火狐)

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"); 

在谷歌鉻這工作,但在firefox與greasemonkey,最後一行失敗,保護不會被刪除。

Error: Component is not available Line: 171 

我該如何解決這個問題,爲什麼它在Firefox下失敗?

回答

0

根據我用於mouseup事件的this post來判斷,您應該可以使用類似document.addEventListener("contextmenu", new Function("return true"), true)的東西。