MCPcopy Create free account
hub / github.com/QLHazyCoder/FlowPilot / matchesSourceUrlFamily

Function matchesSourceUrlFamily

background.js:3337–3368  ·  view source on GitHub ↗
(source, candidateUrl, referenceUrl)

Source from the content-addressed store, hash-verified

3335}
3336
3337function matchesSourceUrlFamily(source, candidateUrl, referenceUrl) {
3338 if (typeof navigationUtils !== 'undefined' && navigationUtils?.matchesSourceUrlFamily) {
3339 return navigationUtils.matchesSourceUrlFamily(source, candidateUrl, referenceUrl);
3340 }
3341 const candidate = parseUrlSafely(candidateUrl);
3342 if (!candidate) return false;
3343 const reference = parseUrlSafely(referenceUrl);
3344 switch (source) {
3345 case 'signup-page':
3346 return isSignupPageHost(candidate.hostname) || isSignupEntryHost(candidate.hostname);
3347 case 'duck-mail':
3348 return candidate.hostname === 'duckduckgo.com' && candidate.pathname.startsWith('/email/');
3349 case 'qq-mail':
3350 return candidate.hostname === 'mail.qq.com' || candidate.hostname === 'wx.mail.qq.com';
3351 case 'mail-163':
3352 return is163MailHost(candidate.hostname);
3353 case 'gmail-mail':
3354 return candidate.hostname === 'mail.google.com';
3355 case 'inbucket-mail':
3356 return Boolean(reference) && candidate.origin === reference.origin && candidate.pathname.startsWith('/m/');
3357 case 'mail-2925':
3358 return candidate.hostname === '2925.com' || candidate.hostname === 'www.2925.com';
3359 case 'vps-panel':
3360 return Boolean(reference) && candidate.origin === reference.origin && candidate.pathname === reference.pathname;
3361 case 'sub2api-panel':
3362 return Boolean(reference)
3363 && candidate.origin === reference.origin
3364 && (candidate.pathname.startsWith('/admin/accounts') || candidate.pathname.startsWith('/login') || candidate.pathname === '/');
3365 default:
3366 return false;
3367 }
3368}
3369
3370async function rememberSourceLastUrl(source, url) {
3371 return tabRuntime.rememberSourceLastUrl(source, url);

Callers

nothing calls this directly

Calls 4

parseUrlSafelyFunction · 0.70
isSignupPageHostFunction · 0.70
isSignupEntryHostFunction · 0.70
is163MailHostFunction · 0.70

Tested by

no test coverage detected