URL Flow Chart
URL Flow Link to heading
An incoming link arrives through one of two intents and always travels the same pipeline before any browser is launched. Non-web schemes (e.g. mailto:) are dropped, and once a URL reaches a browser it is marked so it is never re-processed (loop guard). The shortener-resolution step is opt-in and off by default (zero network):
graph TD
A["Incoming link
ACTION_VIEW — default browser / link tap
or ACTION_SEND — Share sheet"] --> B["Extract and normalize URL
(RuleEngine.normalize)"] B --> C{"Web URL?
(http / https)"} C -->|"no (e.g. mailto:)"| O["Ignore — finish"] C -->|"yes"| D{"Already handled?
(loop guard)"} D -->|"yes"| O D -->|"no"| E["Load enabled rules,
formats, filters, rewrites"] E --> E3["Canonicalize AMP cache URLs
(amp.to / ampproject.org → origin)"] E3 --> F{"Enabled shortener host?
(opt-in, off by default)"} F -->|"no"| E2 F -->|"yes"| G["Resolve shortener to final URL
(pure-JVM; ephemeral WebView fallback)"] G --> E2["Unwrap redirect wrappers
(user formats, e.g. google.com/url)"] E2 --> F2{"Nested shortener host?
(bounded depth)"} F2 -->|"no"| H F2 -->|"yes"| G H["Match rules
(specificity first, list-order tie-break)"] H --> I{"Rule matched?"} I -->|"no"| J["Fallback
(chooser / OS default / block / ask-and-remember / specific browser)"] J --> N["finish"] I -->|"yes"| K["Host rewrite
(first enabled rewrite rule)"] K --> L["Strip tracker query params
(final launched URL only)"] L --> M["Launch in target browser
(private / normal / in-app WebView / Stop)"] M --> N
ACTION_VIEW — default browser / link tap
or ACTION_SEND — Share sheet"] --> B["Extract and normalize URL
(RuleEngine.normalize)"] B --> C{"Web URL?
(http / https)"} C -->|"no (e.g. mailto:)"| O["Ignore — finish"] C -->|"yes"| D{"Already handled?
(loop guard)"} D -->|"yes"| O D -->|"no"| E["Load enabled rules,
formats, filters, rewrites"] E --> E3["Canonicalize AMP cache URLs
(amp.to / ampproject.org → origin)"] E3 --> F{"Enabled shortener host?
(opt-in, off by default)"} F -->|"no"| E2 F -->|"yes"| G["Resolve shortener to final URL
(pure-JVM; ephemeral WebView fallback)"] G --> E2["Unwrap redirect wrappers
(user formats, e.g. google.com/url)"] E2 --> F2{"Nested shortener host?
(bounded depth)"} F2 -->|"no"| H F2 -->|"yes"| G H["Match rules
(specificity first, list-order tie-break)"] H --> I{"Rule matched?"} I -->|"no"| J["Fallback
(chooser / OS default / block / ask-and-remember / specific browser)"] J --> N["finish"] I -->|"yes"| K["Host rewrite
(first enabled rewrite rule)"] K --> L["Strip tracker query params
(final launched URL only)"] L --> M["Launch in target browser
(private / normal / in-app WebView / Stop)"] M --> N