简体   繁体   English

如何在最新的Firefox中简单地测试XPCOM组件?

[英]How can I simply test the XPCOM component in the latest firefox?

In the latest firefox, I found that, when you try to use the following code in web console: 在最新的firefox中,当您尝试在Web控制台中使用以下代码时,我发现了这一点:

netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

[10:33:00.787] Use of enablePrivilege is deprecated.  
Please use code that runs with the system principal (e.g. an extension) instead.

For the firefox 3.6, I always use this way to simply test some of my XPCOM components, it's very convenient. 对于firefox 3.6,我总是使用这种方法来简单地测试一些XPCOM组件,这非常方便。 But in the latest firefox, I found that i cannot be used anymore. 但是在最新的Firefox中,我发现我已无法使用。

So If currently I have written a C++ XPCOM component, is there a simple way that I can try to test it besides having to write and register another test component ? 因此,如果当前我已经编写了C ++ XPCOM组件,除了必须编写和注册另一个test component之外,是否有一种简单的方法可以尝试对其进行test component

Of course, any suggestion is very appreciated. 当然,任何建议都非常感谢。

Binary (C++) XPCOM usage is very heavily discouraged (or to put it more firmly, DEAD DEAD DEAD ) in recent Firefox builds: 二进制(C ++)XPCOM使用是非常沉重劝阻(或把它更加坚定, 死死DEAD)在最近Firefox的建立:

MDN specifies alternatives for getting binary XPCOM components, although I don't know if any are an improvement for your scenario: MDN指定了获取二进制XPCOM组件的替代方法,尽管我不知道有什么方法可以改善您的情况:

https://developer.mozilla.org/En/Firefox_addons_developer_guide/Using_XPCOM —Implementing_advanced_processes https://developer.mozilla.org/zh-CN/Firefox_addons_developer_guide/Using_XPCOM —Implementing_advanced_processes

Formerly binary components should now use js-ctypes: 以前,二进制组件现在应该使用js-ctypes:

https://developer.mozilla.org/en/js-ctypes https://developer.mozilla.org/en/js-ctypes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM