Bug 1462989 Comment 93 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Richard Bloor from comment #92)
> However, I couldn't see any way of switching the listener between returning a promise standard call back. Given that Firefox 52  was released some time ago, should we change the documentation to note that webRequest.onHeadersReceived returns a promise?

The listener is a user-defined function. Returning a BlockingResponse is valid (and supported by other browsers too), whereas Firefox also supports a Promise. I would keep the existing return type (BlockingResponse), and also note that the a Promise is supported as a return value.
(In reply to Richard Bloor from comment #92)
> However, I couldn't see any way of switching the listener between returning a promise standard call back. Given that Firefox 52  was released some time ago, should we change the documentation to note that webRequest.onHeadersReceived returns a promise?

The listener is a user-defined function. Returning a BlockingResponse is valid (and supported by other browsers too), whereas Firefox also supports a Promise. I would keep the existing return type (BlockingResponse), and also note that the a Promise is supported as a return value (in Firefox only).

Back to Bug 1462989 Comment 93