fix: a slow answer to an approval still reaches the site (closes #540)
Chrome stopped the background worker about six minutes after a site's request even with the approval window open, and the approval and the site's waiting request went with it. Every approval is now added through addPendingApproval(), which starts a timer in the worker that calls runtime.getPlatformInfo() every 20 seconds while any approval is pending; Chrome counts each call as activity. tests/e2e/slowApproval.js, run by make test-e2e, leaves a transaction and a signature approval open for seven minutes in minimized windows and requires the site to receive both results. It drives Chromium over the DevTools pipe because Playwright keeps DevTools attached to the worker. Its loopback dApp server, shared with the Firefox suite, moves to tests/e2e/dapp.js. Model: opus-5-5
This commit was merged in pull request #553.
This commit is contained in:
@@ -145,6 +145,14 @@ function sendMessage(message) {
|
||||
return invoke(runtimeApi(), "sendMessage", message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Object>} the operating system and processor the browser
|
||||
* runs on.
|
||||
*/
|
||||
function getPlatformInfo() {
|
||||
return invoke(runtimeApi(), "getPlatformInfo");
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message nobody is expected to answer, and swallow the fact that
|
||||
* nobody did.
|
||||
@@ -262,6 +270,7 @@ module.exports = {
|
||||
actionApi,
|
||||
alarmsApi,
|
||||
extensionApi,
|
||||
getPlatformInfo,
|
||||
hasBrowserNamespace,
|
||||
notify,
|
||||
runtimeApi,
|
||||
|
||||
Reference in New Issue
Block a user