-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Proposal: Persistent Authentication
Background
Extensions use webRequest.onAuthRequired.addListener
in the background script to provide authentication. In MV3, when the background script is unloaded, restarting it, retrieving the necessary data asynchronously from the storage
, and processing the data, can take up some time, which results in the unwanted authentication popup from the browser.
Ideally, a persistent method to provide the authentication data is needed.
Some APIs such as Menus and Scripting already support persistent data.
Proposal
Create a method to provide persistent authentication data
Suggestions
1. Persistent onAuthRequired
Make the listener and its data persistent
Here is an example of setting persistent rules that browser would handle.
It can be set under proxy.settings
which would mean another extension won't interfere with it once 'controlled_by_this_extension'
is set (or have a per-extension setting).
proxy.settings.authentication = [
{host, port, username, password},
];
// --- or
webRequest.onAuthRequired.rules = [
{host, port, username, password},
];
2. declarativeNetRequest
Adapt DNR to provide persistent authorisation data
The rule-based DNR approach (versus an event-based one) might prove to be more efficient in the long run and eliminate the need for a webRequest.onAuthRequired.addListener
.
See also: