preferences.sqlite

User Help for Mozilla Firefox
Post Reply
havealoha
Posts: 1
Joined: October 27th, 2011, 8:15 am

preferences.sqlite

Post by havealoha »

We want to add certain default popup exceptions to existing users profiles for sites in our organization. For a new profile, a default permissions.sqlite can be specified but what to do for existing profiles?

We were able to create a textfile containing:

INSERT INTO "moz_hosts" VALUES(999,'www.lotsofpopups','popup',1,0,0);
INSERT INTO "moz_hosts" VALUES(1000,'*.morepopupshere.com','popup',1,0,0);

and import that into the users permissions.sqlite file using:

sqlite3.exe permissions.sqlite < insert-permissions.sql , problem with this is how and when do we run it? Start Menu/Startup? Login script? Task Scheduler?

What are other ways to accomplish this? Can we get local-settings.js or mozilla.cfg to add these somehow? Can .js call sqlite to insert these records? Is there a lockPref to add permissions/exceptions?

It seems that enterprise manageability and or documentation of such features for firefox is lacking. All the GPO/ADMX projects look stale. Id rather have something native. Any plans here?
clawsonton
Guest

Re: preferences.sqlite

Post by clawsonton »

Wouldnt something in /defaults/pref/local-settings.js like this work?

//
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/FileUtils.jsm");

let file = FileUtils.getFile("ProfD", ["permissions.sqlite"]);
let mDBConn = Services.storage.openDatabase(file); // Will also create the file if it does not exist

dbConn.executeSimpleSQL("INSERT INTO "moz_hosts" VALUES(999,'www.lotsofpopups','popup',1,0,0);");

mozIStorageConnection.close()

We could really use a working example here.... Shouldnt this be moved to the developers forum?
Post Reply