Navigation Menu

Skip to content

Commit

Permalink
Closes mozilla#32: Whitelist access for mozApps.mgmt.getAll
Browse files Browse the repository at this point in the history
granting white-listed hosts access to "webapps-manage" Services
  • Loading branch information
Maxim Zhilyaev authored and Mardak committed Nov 2, 2012
1 parent 51af270 commit c3fca61
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions siteSuggest/lib/main.js
Expand Up @@ -11,6 +11,13 @@ const {watchWindows} = require("watchWindows");

Cu.import("resource://gre/modules/Services.jsm", this);

// list of hosts granted access permission to apps installation list
const MOZAPP_PAGES_WHITE_LIST = [
"https://newnewtab.mozillalabs.com/",
"https://newnewtab-dev.mozillalabs.com/",
"https://newnewtab-stage.mozillalabs.com/"
];

/**
* User profile object
*/
Expand Down Expand Up @@ -75,6 +82,13 @@ function addAppsButton(window, browser) {
}

exports.main = function(options) {
// grant permissions to manage installed apps
MOZAPP_PAGES_WHITE_LIST.forEach(function(host) {
Services.perms.add(Services.io.newURI(host, null, null),
"webapps-manage",
Ci.nsIPermissionManager.ALLOW_ACTION);
});

// per-window initialization
watchWindows(function(window) {
let {gBrowser} = window;
Expand Down

0 comments on commit c3fca61

Please sign in to comment.