1 Commits
Author SHA1 Message Date
sneak fd3700da9d fix: Blockscout and Etherscan lookups are off until the user turns them on (closes #668)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s
Out of the box the wallet sent the user's addresses to Blockscout for history
and token lookups. It sent each recipient to Etherscan for its label. Two
settings, "Use Blockscout" and "Check recipients on Etherscan", now gate those
requests. Both are off in a new install and offered unticked on Welcome and in
Settings. While one is off, the screens that relied on it say so in a plain
line. The balance refresh and the Etherscan check read the stored setting. An
open popup takes a change another page saved and draws its screens again. While
"Use Blockscout" is off, no address keeps an untracked token. ENS lookups ask
only the RPC endpoint.

Model: opus-5-5
2026-10-26 06:38:59 +00:00
3 changed files with 12 additions and 4 deletions

No files matched your search

+2 -2
View File
@@ -1642,8 +1642,8 @@ dropdown was filled under the old setting. "Back" cannot render Send again. A
change to "Check recipients on Etherscan" leaves the stack as it is.
Any other popup open meanwhile takes either change from the stored record, as it
takes a network switch (below). It then draws its screen on top again under the
new setting.
takes a network switch (below). It then draws its screen on top again as a
reopened popup draws it, so Home takes the place of a screen such as Send.
A network switch leaves every screen on the page showing the previous network.
The user makes it in Settings, or approves a site's request and the background
+7 -2
View File
@@ -4,6 +4,7 @@
const { networkByChainId } = require("./networks");
const { storageGet } = require("./browserApi");
const { normalizePersisted } = require("./persistedState");
// Patterns in the page title that indicate a flagged address.
// Title format: "Fake_Phishing184810 | Address: 0x... | Etherscan"
@@ -81,7 +82,9 @@ function parseEtherscanPage(html) {
*
* Etherscan is asked only while "Check recipients on Etherscan" is on in the
* stored profile. The page's own copy of the setting is not used, because
* another page may have just changed it. While it is off, the answer is null.
* another page may have just changed it. The stored setting is read through
* normalizePersisted(), so it is on only when a load would find it on. While
* it is off, the answer is null.
*
* @param {string} address - Ethereum address to check.
* @param {string} [chainId] - Chain id of the network to look it up on.
@@ -90,7 +93,9 @@ function parseEtherscanPage(html) {
async function checkEtherscanLabel(address, chainId) {
try {
const { autistmask } = await storageGet("autistmask");
if (!autistmask || !autistmask.checkRecipientsOnEtherscan) return null;
if (!normalizePersisted(autistmask).checkRecipientsOnEtherscan) {
return null;
}
// Lazy require to avoid pulling in chrome.storage at module scope
// (which breaks unit tests that only exercise parseEtherscanPage).
const { currentNetwork } = require("./state");
@@ -157,6 +157,9 @@ describe("where each request is made", () => {
await checkWith({});
await checkWith({ autistmask: { checkRecipientsOnEtherscan: false } });
// Only a stored true is on, as when the profile is loaded.
await checkWith({ autistmask: { checkRecipientsOnEtherscan: "true" } });
await checkWith({ autistmask: { checkRecipientsOnEtherscan: 42 } });
expect(asked).toEqual([]);
await checkWith({ autistmask: { checkRecipientsOnEtherscan: true } });