mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Perform LoadURL checks for WebExtensions.
This commit is contained in:
parent
c9717cf3d1
commit
c2c3d90841
3 changed files with 7 additions and 0 deletions
|
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue