MCPcopy
hub / github.com/darkreader/darkreader / getURLHostOrProtocol

Function getURLHostOrProtocol

src/utils/url.ts:73–81  ·  view source on GitHub ↗
($url: string)

Source from the content-addressed store, hash-verified

71}
72
73export function getURLHostOrProtocol($url: string): string {
74 const url = new URL($url);
75 if (url.host) {
76 return url.host;
77 } else if (url.protocol === 'file:') {
78 return url.pathname;
79 }
80 return url.protocol;
81}
82
83export function compareURLPatterns(a: string, b: string): number {
84 return a.localeCompare(b);

Callers 8

sendMessageMethod · 0.90
toggleActiveTabMethod · 0.90
BodyFunction · 0.90
getSiteToggleDataFunction · 0.90
CustomSettingsToggleFunction · 0.90
PresetPickerFunction · 0.90
listenerFunction · 0.90
url.tests.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected