2013-02-13 10 views
0

Mozilla的驗證程序只是向我報告:現在如何更新Firefox插件以適應「服務模塊」替換?

E4X Deprecated/Removed

Error: It is no longer possible to pass E4X objects between most contexts, including different chrome windows or JS modules. E4X will be completely removed by Gecko 20 (or possibly earlier). See https://developer.mozilla.org/en-US/docs/E4X for more information.

,錯誤的是在這條線:

Components.utils.import("resource://gre/modules/Services.jsm"); 
const XUL = Namespace("xul", "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 

Mozilla的驗證程序點到page that proposes this as a solution

Warning: E4X is obsolete. It has been disabled by default for webpages (content) in Firefox 17, disabled by default for chrome in Firefox 20, and will be removed in Firefox 21. Use DOMParser/DOMSerializer or a non-native JXON algorithm instead.

var response = xmlhttprequest.responseText; // bug 270553 
response = response.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, ""); // bug 336551 
var e4x = new XML(response); 

我在這裏我的聯盟有點不合時宜,不知道該怎麼做。任何線索將不勝感激。我如何使用它?

+0

這似乎不是對我來說正確的線路錯誤。你能分享更多的代碼嗎?我還假設驗證器是http://addons.mozilla.org/提交驗證器。 – 2013-02-14 21:53:44

+0

克拉克先生,您是否看到我在「錯誤行」中添加了第二行?你有嗎? – bgmCoder 2013-02-14 22:09:51

回答

0

啊,它是代碼字符串的第二行。

的問題是在這裏(由AMO編輯一個向我建議):

const XUL = Namespace("xul", "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 

定義常數什麼訪問的E4X對象。我從來沒有在我的任何代碼中使用這個常量 - 它只是在那裏,因爲我在原來的插件示例中看到它,並將它複製過來。

我刪除它後,驗證程序不再投訴。當我提交更新的插件時,它通過並得到了正式批准。

+1

僅供參考,以下是特定功能的文檔:https://developer.mozilla.org/en-US/docs/XUL/School_tutorial/DOM_Building_and_HTML_Insertion – 2013-02-14 23:39:02

+0

感謝羅布,鏈接。 – bgmCoder 2013-02-15 01:30:10