Open Bug 1391312 Opened 7 years ago Updated 2 years ago

Add frameId propertie to webRequest.RequestFilter

Categories

(WebExtensions :: Request Handling, defect, P5)

defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: kernp25, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:57.0) Gecko/20100101 Firefox/57.0 Build ID: 20170817100132 Steps to reproduce: Because in my add-on i need to listen for: "onCompleted", "onErrorOccurred" and "onBeforeRedirect". But only one time (for performance reasons) Expected results: In runtime.onMessage listener: browser.webRequest.onBeforeRequest.addListener( check, {urls: [url], tabId: sender.tab.id, frameId: sender.frameId} ); Because my content script loads into all frames [1] ("all_frames") Frame can also be a "object" (e.g. embed) The webRequest.ResourceType [2] will be "object" not "sub_frame" The above example can also be written like so: browser.webRequest.onBeforeRequest.addListener( check, {urls: ['<all_urls>'], frameId: 0 /* listen for main_frame */} ); [1] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/content_scripts#all_frames [2] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/ResourceType
Priority: -- → P5
Product: Toolkit → WebExtensions
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.