我得到這個尷尬的錯誤任何時候我嘗試從 的Greasemonkey創建一個對話框時調用......我相信它有做的 XPCNativeWrapper https://developer.mozilla.org/en/XPCNativeWrapper#Limitations_of_XPCNativeWrapper 的限制,雖然我我不是100%確定的。jQuery UI的對話框拋出錯誤當從Greasemonkey的
我使用的核心jQuery方法都沒有引起錯誤 (append,css,submit,keydown,each,...)。
這是可能的,這可能是在Greasemonkey的或由於 的Greasemonkey和jQuery UI之間的相互作用的錯誤,但我真的 興趣搞清楚如何讓他們一起工作。
// ==UserScript==
// @name Dialog Test
// @namespace http://strd6.com
// @description jquery-ui-1.6rc6 Dialog Test
// @include *
//
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js
// @require http://strd6.com/stuff/jqui/jquery-ui-personalized-1.6rc6.min.js
// ==/UserScript==
$(document).ready(function() {
$('<div title="Test">SomeText</div>').dialog();
});
錯誤: [異常... 「組件不可用」 nsresult: 「0x80040111 (NS_ERROR_NOT_AVAILABLE)」 位置:「JS幀:: 文件:///home/daniel/.mozilla/火狐/.../組件/ greasemonkey.js :: 匿名::管線347" 的數據:無] [該誤差打破]如果(線){
火狐版本: 的Mozilla/5.0(X11; U; Linux i686; en-US; rv:1.9.0.6)Gecko/2009020911 Ubuntu/8.04(hardy)Firefox/3.0.6
更新:從標準的jQuery庫中的焦點()方法也拋出了同樣的錯誤:
$('body').focus();
也許UI呼籲在一些點對焦方法?
任何幫助將不勝感激!
>>某些GM方法不能從不安全的上下文中調用<<您是否找到了解決方案?我真的很感興趣。 – eWolf 2009-12-22 13:30:05