waiter waiter more webextensions please

This commit is contained in:
wuggy 2026-09-14 14:37:34 -07:00
commit bb0adb61ae
10 changed files with 198 additions and 8 deletions

View file

@ -115,6 +115,20 @@ function WebNavigationEventManager(context, eventName) {
parentFrameId: ExtensionManagement.getParentFrameId(data.parentWindowId, data.windowId),
};
if (eventName == "onCreatedNavigationTarget") {
let source = {};
extensions.emit("fill-browser-data", data.sourceTabBrowser, source);
if (!(source.tabId >= 0)) {
return;
}
delete data2.frameId;
delete data2.parentFrameId;
data2.sourceTabId = source.tabId;
data2.sourceFrameId = ExtensionManagement.getFrameId(data.sourceWindowId);
// Firefox does not expose renderer process IDs through this API.
data2.sourceProcessId = -1;
}
if (eventName == "onErrorOccurred") {
data2.error = data.error;
}
@ -162,7 +176,7 @@ extensions.registerSchemaAPI("webNavigation", "addon_parent", context => {
onErrorOccurred: new WebNavigationEventManager(context, "onErrorOccurred").api(),
onReferenceFragmentUpdated: new WebNavigationEventManager(context, "onReferenceFragmentUpdated").api(),
onHistoryStateUpdated: new WebNavigationEventManager(context, "onHistoryStateUpdated").api(),
onCreatedNavigationTarget: ignoreEvent(context, "webNavigation.onCreatedNavigationTarget"),
onCreatedNavigationTarget: new WebNavigationEventManager(context, "onCreatedNavigationTarget").api(),
getAllFrames(details) {
let tab = TabManager.getTab(details.tabId, context);

View file

@ -284,7 +284,6 @@
},
{
"name": "onCreatedNavigationTarget",
"unsupported": true,
"type": "function",
"description": "Fired when a new window, or a new tab in an existing window, is created to host a navigation.",
"parameters": [