Skip to content

Commit eecd2d5

Browse files
committed
fix: root domain match should not skip explicit navigation requests
Root domain matching in _navigateToUrl was incorrectly skipping navigation when user explicitly requests a different subdomain URL (e.g. mp.csdn.net when on www.csdn.net). Root domain matching should only prevent creating duplicate tabs, not block navigation.
1 parent db114fa commit eecd2d5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/src/cli/serve.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,8 @@ Future<void> _navigateToUrl(CdpDriver cdp, String url, int cdpPort) async {
272272
final tabUrl = matchingTab['url'] as String? ?? '';
273273
if (tabUrl == url) {
274274
// Already on exact URL — skip navigation
275-
} else if (isRootDomainMatch) {
276-
// Same root domain but different subdomain (e.g. login page redirected)
277-
// The tab is likely already logged in — skip navigation to avoid loops
278-
print(' ℹ️ Same root domain ($targetRoot), skipping re-navigation');
279275
} else {
280-
// Same origin, different path — navigate
276+
// Navigate (even for root domain matches — user explicitly requested this URL)
281277
await cdp.call('Page.navigate', {'url': url});
282278
await Future.delayed(const Duration(seconds: 3));
283279
await _retryWithJsNavIfBroken(cdp, url);

0 commit comments

Comments
 (0)