Closed
Bug 1517329
Opened 7 years ago
Closed 7 years ago
Add windowId propertie to webRequest details object
Categories
(WebExtensions :: Request Handling, enhancement)
WebExtensions
Request Handling
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: kernp25, Unassigned)
Details
So we can get information in what window the request is loading.
webNavigation also has windowId propertie in details object.
I know, that i can do:
function redirectAsync(requestDetails) {
return new Promise(async (resolve, reject) => {
let tabInfo = await browser.tabs.get(requestDetails.tabId);
console.log(tabInfo.windowId);
});
}
browser.webRequest.onBeforeRequest.addListener(
redirectAsync,
{urls: ["https://example.com/*"], types: ["main_frame"]},
["blocking"]
);
But this does not work for onResponseStarted or onCompleted event.
Comment 3•7 years ago
|
||
Neither of those take a result from the listener and neither are blocking so you shouldn't try to behave like they are. There is no reason that getting the windowId wouldn't work just like this:
browser.webRequest.onCompleted.addListener(async (details) => {
let info = await browser.tabs.get(details.tabId);
console.log(info);
}, ...);
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(mixedpuppy)
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•