asyncBlocking in webRequest.onAuthRequired#34137
Conversation
|
Preview URLs
External URLs (2)URL:
(comment last updated: 2024-07-18 09:21:19) |
There was a problem hiding this comment.
It looks like there may have been a miscommunication around how async handling of onAuthRequired events work in Firefox 128+. The version of this PR I'm reviewing seems to say that Firefox 128 and later no longer support asynchronous response handling in "blocking" listeners. Based on my reading of Firefox source, it appears that blocking listeners can still return promises to asynchronously settle an onAuthRequired events. What has changed is that Firefox now supports registering onAuthRequired listeners with "asyncBlocking" and these listeners match the behavior seen in Chrome.
All changes suggested in this review are for illustrative purposes. I'm happy to defer to your judgement on how best to structure the related content.
Co-authored-by: Simeon Vincent <svincent@gmail.com>
|
@dotproto I need to check the language in the changes and fix some formatting issues but in the meanwhile, could you check my latest updates, do they address your feedback? |
|
This pull request has merge conflicts that must be resolved before it can be merged. |
|
This pull request has merge conflicts that must be resolved before it can be merged. |
|
This pull request has merge conflicts that must be resolved before it can be merged. |
|
@rebloor, I just created a test extension to flex the various ways that an |
Co-authored-by: Simeon Vincent <svincent@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| - : `object`. Details about the request. See the [details](#details_2) section for more information. | ||
| - `asyncCallback` {{optional_inline}} | ||
|
|
||
|
|
There was a problem hiding this comment.
[mdn-linter] reported by reviewdog 🐶
There was a problem hiding this comment.
@rebloor, any idea why mdn-linter is generating linter warnings that aren't showing up when doing a local yarn lint:md or know who we could tag about that?
| - in addListener, pass `"asyncBlocking"` in Chrome and Firefox or `"blocking"` in Firefox in the `extraInfoSpec` parameter | ||
| - If `"blocking"` is provided, the extension can return a `webRequest.BlockingResponse` object or a Promise that resolves to a `webRequest.BlockingResponse` object | ||
| - If `"asyncBlocking"` is provided, the event listener function receives a `asyncCallback` function as its second parameter. `asyncCallback`can be called asynchronously and takes a`webRequest.BlockingResponse` object as its only parameter | ||
|
|
||
| > **Note:** Chrome does not support a Promise as a return value ([Chromium issue 1510405](https://crbug.com/1510405)). For alternatives, see [the return value of the `listener`](#listener). |
There was a problem hiding this comment.
It looks like this information is a bit redundant given the recent changes to the extraInfoSpec parameter documentation. Should we remove this block and link to that property for details? I'm happy to defer to your judgement.
Description
Addresses the documentation requirements of Bug 1889897 Implement asyncBlocking support for webRequest.onAuthRequired, including: