MozillaZine


preferences.sqlite

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

Post Posted October 27th, 2011, 8:32 am

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
 

Post Posted October 27th, 2011, 9:16 pm

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?

Return to Firefox Support


Who is online

Users browsing this forum: No registered users and 6 guests