This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Components.utils.import("resource://gre/modules/Services.jsm"); | |
let redirects; | |
let pref = { | |
name: "extensions.something.pref", | |
init: function() { | |
this.readPref(); | |
Services.prefs.addObserver(this.name, this, false); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var start = Date.now(); | |
var cutoff = (Date.now() - 180 * 86400000) * 1000; | |
var min_frecency = 50; | |
PlacesUtils.history.DBConnection.createAsyncStatement( | |
'UPDATE moz_places SET ' + | |
'visit_count = MAX((SELECT COUNT(*) FROM moz_historyvisits WHERE place_id = moz_places.id AND visit_date > ' + cutoff + '), 1) ' + | |
'WHERE frecency > ' + min_frecency | |
).executeAsync({ | |
handleCompletion: function() { | |
PlacesUtils.history.DBConnection.createAsyncStatement( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
let ww = gBrowser.selectedBrowser.boxObject.width; | |
let wu = gBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); | |
let w = parseFloat(wu.getDocumentMetadata("viewport-width")); | |
//gBrowser.contentDocument.documentElement.style.width = w + 'px'; | |
if (!isNaN(w)) | |
ZoomManager.zoom = ww/w; | |
} |
NewerOlder