Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

permissions.sqlite

134 views
Skip to first unread message

Portland Alternative Badminton

unread,
Nov 1, 2011, 12:14:38 AM11/1/11
to

originally posted on mozillazine, no activity, posting here...

havealoha Posts: 1Joined: October 27th, 2011, 8:15 am


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?

--------------------------------------------------------------------------------



clawsontonGuest


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?
0 new messages