Open Bug 1420639 Opened 5 years ago Updated 6 months ago

channel.frameAncestors throws NS_ERROR_UNEXPECTED for frames embedded within chrome pages


(WebExtensions :: Request Handling, defect, P5)



(Not tracked)


(Reporter: simon.lindholm10, Unassigned)



I have an addon that registers a onHeadersReceived listener like this:

	() => { return {}; }, // do nothing
	{urls: ["<all_urls>"], types: ["image", "imageset"]},
	["blocking", "responseHeaders"]

When I open the "Get Add-Ons" tab of about:addons, some image gets requested, and this causes some system code to log the following to the browser console:

[Exception... "Unexpected error"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: resource://gre/modules/WebRequest.jsm :: getRequestData :: line 684"  data: no]

where WebRequest.jsm:684 is this line:

      frameAncestors: channel.frameAncestors || undefined,

I'm guessing that triggers due to the system principle not having a URI.

Not sure what *should* happen here -- should/do webRequest handlers even work for web content embedded in about:addons? -- but either way it shouldn't log an error. I guess either ChannelWrapper::GetFrameAncestors should break instead of return NS_ERROR_UNEXPECTED, or the consumer in WebRequest.jsm should do a try-catch.
Priority: -- → P5
Product: Toolkit → WebExtensions
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.