javascript - 扩展程序如何读取注册表

标签 javascript firefox firefox-addon registry

我想从扩展的 javascript 中读取窗口注册表值。对于 Internet Explorer,我们可以使用 ActiveXObject。但是不知道如何在 Firefox 中读取注册表。

请帮帮我

最佳答案

nsIWindowsRegKey interface是你的 friend 。 Accessing the Windows Registry Using XPCOM有一些例子,例如:

var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
                    .createInstance(Components.interfaces.nsIWindowsRegKey);
wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
         "SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
         wrk.ACCESS_READ);
var id = wrk.readStringValue("ProductId");
wrk.close();

关于javascript - 扩展程序如何读取注册表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11934159/

相关文章:

javascript - Firefox 扩展中的 SQLite3 错误

javascript - 谷歌脚本: Clear content of cells with specific background (to slow)

javascript - 如何取消选择除另一个图例之外的所有图例,它不应该在echarts中取消选择

javascript - 压缩我的 jQuery

firefox - 之前设置的 "Samesite: Strict"cookie 在 document.cookie 中不可用 Firefox 和 Safari

c# - 如何使用 C# 编程语言通过 Visual Studio 编写 FireFox 扩展?

javascript - 从匿名函数中访问 "this"

Firefox 字体问题 - Bootstrap Glyphicons

python selenium 多个测试用例

Firefox 总是显示菜单栏工具栏