我检查了注册表周围的所有内容,但是找不到所有已安装扩展的列表.
此时,IE扩展/附加组件的任何常规位置都会有所帮助.
我在将存储浏览器历史记录的文件中找到的日期转换为正常的DateTime时遇到麻烦。
该文件位于:C:\ Users [用户名] \ AppData \ Roaming \ Mozilla \ Firefox \ Profiles [配置文件名称] \ places.sqlite
有问题的表格是:[moz_places]
该列为:[last_visit_date]
我已经尝试过使用unix纪元和webkit格式(例如chrome使用),但是都没有给我期望的结果。
这是我的Unix转换(不起作用):
public static DateTime FromUnixTime(long unixTime)
{
var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
return epoch.AddSeconds(unixTime);
}
Run Code Online (Sandbox Code Playgroud)
这是我的Webkit转换代码:(也不适用于这些日期,它适用于Chromes Webkit日期)
public static DateTime ConvertWebkitTimeToDateTime(long ticks)
{
//Set up a date at the traditional starting point for unix time.
DateTime normalDate = new DateTime(1970, 1, 1, 0, 0, 0, 0);
//Subtract the amount of seconds from 1601 to …Run Code Online (Sandbox Code Playgroud) 我有一个Firefox扩展,需要检查onUnload事件.基本上我想在用户禁用扩展时向我的服务器发送消息.
我尝试做的是向我的一个内容脚本发送一条消息,然后调用XMLHttpRequest.这为扩展触发任何其他事件工作正常,但它会出现内容脚本得到卸载的消息,甚至获得通过之前.
以下是main.js脚本中的代码:
exports.onUnload = function(reason) {
//unloadWorker comes from a PageMod 'onAttach: function(worker){}'
//That is called every time a page loads, so it will a recent worker.
if(unloadWorker != null) {
unloadWorker.port.emit("sendOnUnloadEvent", settings, reason);
}
};
Run Code Online (Sandbox Code Playgroud)
以下是我附加到每个加载页面的内容脚本中的代码.
self.port.on("sendOnUnloadEvent", function(settings, reason) {
console.log("sending on unload event to servers");
settings.subid = reason;
if(reason != "shutdown") {
sendEvent(("on_unload"), settings);
}
});
Run Code Online (Sandbox Code Playgroud)
最后,这里是发送事件代码,仅供参考我最初计划如何使用XMLHttpRequest:
sendEvent = function(eventName, settings) {
if (!eventName) {
eventName = "ping";
}
//Not the actual URL, but …Run Code Online (Sandbox Code Playgroud)