Perform LoadURL checks for WebExtensions.

This commit is contained in:
wolfbeast 2018-02-08 11:37:12 +01:00 committed by Roy Tam
commit c2c3d90841
3 changed files with 7 additions and 0 deletions

View file

@ -497,6 +497,9 @@ extensions.registerSchemaAPI("browserAction", "addon_parent", context => {
// For internal consistency, we currently resolve both relative to the
// calling context.
let url = details.popup && context.uri.resolve(details.popup);
if (url && !context.checkLoadURL(url)) {
return Promise.reject({message: `Access denied for URL ${url}`});
}
BrowserAction.for(extension).setProperty(tab, "popup", url);
},

View file

@ -273,6 +273,9 @@ extensions.registerSchemaAPI("pageAction", "addon_parent", context => {
// For internal consistency, we currently resolve both relative to the
// calling context.
let url = details.popup && context.uri.resolve(details.popup);
if (url && !context.checkLoadURL(url)) {
return Promise.reject({message: `Access denied for URL ${url}`});
}
PageAction.for(extension).setProperty(tab, "popup", url);
},

View file

@ -173,6 +173,7 @@
{
"name": "setPopup",
"type": "function",
"async": true,
"description": "Sets the html document to be opened as a popup when the user clicks on the page action's icon.",
"parameters": [
{