Skip to content

frontend: add optional onion block explorer URLs#4192

Draft
smokyisthatyou wants to merge 4 commits into
BitBoxSwiss:masterfrom
smokyisthatyou:onion-explorer-links
Draft

frontend: add optional onion block explorer URLs#4192
smokyisthatyou wants to merge 4 commits into
BitBoxSwiss:masterfrom
smokyisthatyou:onion-explorer-links

Conversation

@smokyisthatyou

Copy link
Copy Markdown
Contributor

Add an expert setting to use mempool's .onion address for BTC/TBTC explorer links, whitelist the URLs in SystemOpen, and route existing explorer link call sites through a shared BlockExplorerLink component.

Before asking for reviews, here is a check list of the most common things you might need to consider:

  • updating the Changelog
  • writing unit tests
  • checking if your changes affect other coins or tokens in unintended ways
  • testing on multiple environments (Qt, Android, ...)
  • having an AI review your changes

Add an expert setting to use mempool's .onion address for BTC/TBTC
explorer links, whitelist the URLs in SystemOpen, and route existing
explorer link call sites through a shared BlockExplorerLink component.
Use the same direct-open behavior as desktop.
When .onion explorer URLs are enabled, Android opens a dual-intent
chooser so users can pick Tor Browser or a clearnet browser.
}
}

public static void systemOpenExplorerChooser(Application application, String onionUrl, String clearnetUrl) throws Exception {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not always give the choice when Tor proxy is enabled?

Does Android make the URL visible in the chooser? Can one pick the browser too app too? Screenshots would be nice :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onion explorer URLs are separate from tor proxy because the proxy only affects in-app traffic, not the external browser. i supposed that maybe some users want to open the mempool onion address even if they do not have the tor proxy enabled.

posting android screenshots asap :)

@smokyisthatyou smokyisthatyou Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after some testing, I can say the Android chooser does not appear reliably: once a default browser is set, it is not shown, even when multiple browsers are installed (including Tor).
i still want to try on a physical device, since Tor Browser keeps crashing on the emulator, and that may be affecting the behavior.

if the chooser does not appear as soon as a default browser is selected though, I don’t think it makes sense to keep this option. we should probably open the onion URL directly when the setting is enabled instead, as per other operating systems :)

darkmode?: boolean;
expertFee?: boolean;
coinControl?: boolean;
useOnionExplorerUrls?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is a setting, why is there a chooser? If toggled on, shouldn't it do the onion url?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes in theory, and i was considering it actually. but my thinking was that on mobile, i suppose not many users to have tor browser as default, so having to chose on mobile seemed reasonable.

i am not 100% sure yet though, that's why i left the pr on draft 😁
wdyt? would you think that opening the onion url right away also on mobile could be better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants