thunderbird 二次开发 xpcom 获取 pref 配置
admin | firefox 插件, xul | 2015-01-06
C++
bool showProgress = false;
nsCOMPtr<nsIPrefBranch> prefBranch (do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefBranch)
prefBranch->GetBoolPref("mailnews.show_send_progress", &showProgress);
1234
bool showProgress = false;nsCOMPtr<nsIPrefBran... [阅读全文]
js ctypes 操作注册表
admin | firefox 插件, xul | 2014-11-28
JavaScript
function getLocalVersion(){
//::RegSetValueExA(m_hkey, key.c_str(), 0, REG_SZ, (BYTE*)val.c_str(), (DWORD)val.size());
//if (::RegOpenKeyExA(hkey, subKey.c_str(), 0, KEY_ALL_ACCESS, &m_hkey) != ERROR_SUCCESS)
var lib = ctypes.open("Advapi32.dll");
var RegQueryValueExW = lib.d... [阅读全文]
xulrunner 判断系统版本
admin | xul | 2014-10-23
JavaScript
function GetOS()
{
if (gOS)
return gOS;
var platform = navigator.platform.toLowerCase();
if (platform.contains("win"))
gOS = gWin;
else if (platform.contains("mac"))
gOS = gMac;
else if (platform.contains("unix") || platform.contains("linux") || platform.co... [阅读全文]
使用nsIHelperAppLauncher.SaveToDisk保存文件时,会弹窗firefox的下载窗口
admin | xul | 2014-10-22
JavaScript
使用nsIHelperAppLauncher.SaveToDisk保存文件时,会弹窗firefox的下载窗口, 当任务完成时关闭窗口或者是禁止这个窗口
用 Xpcom.GetService<nsIWindowWatcher>("@mozilla.org/embedcomp/window-watcher;1") .OpenWindow(null,chrome://mozapps/content/downloads/downloads.xul) 可以打开这个窗体,我尝试过... [阅读全文]
Firefox下完整读写本地文件的方法
admin | JavaScript, xul | 2014-10-16
JavaScript
//保存为本地文件
function save(path,content) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch (e) {
alert("Permission to save file was denied.");
... [阅读全文]
xpcom js 获取 文件路径
admin | xul | 2014-10-16
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDirectoryServiceProvider/getFile
JavaScript
var localFile = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties).get("CurProcD", Ci.nsIFile);
localFile.append("123.txt");
... [阅读全文]
不通过xpcom技术,使用js-ctypes在addon中直接调用dll中的函数
admin | JavaScript, xul | 2014-09-24
js-ctypes 非常强大,是我们可以摆脱xpcom技术带来的版本兼容性束缚!这里我们先提供一个最简单的例子来说明如何使用ctypes:
更多信息请参考MDN相关文献
https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes
欢迎有兴趣和疑问的同学请回帖。
JavaScript
Components.utils.import("resource://gre/modules/ctypes.j... [阅读全文]
xulrunner js sqlite Storage
admin | xul | 2014-09-22
https://developer.mozilla.org/cn/docs/Storage
[阅读全文]
XUL controls
admin | xul | 2014-09-15
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/XUL_controls
[阅读全文]
html 通过css设置 图片层叠
admin | xul | 2014-09-11
CSS
.父节点类{
position:relative;
}
.子节点类{
position:absolute;
left:4px;
right: 4px;
top:36px;
z-index:10;
}
1234567891011
.父节点类{ position:relative;} .子节点类{ position:absolute; left:4px; &nb... [阅读全文]