MCPcopy Index your code
hub / github.com/darkreader/darkreader / getDomain

Function getDomain

src/generators/utils/parse.ts:63–69  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

61
62// URL patterns are guaranteed to not have protocol and leading '/'
63export function getDomain(url: string): string {
64 try {
65 return (new URL(url)).hostname.toLowerCase();
66 } catch (error) {
67 return url.split('/')[0].toLowerCase();
68 }
69}
70
71function processSiteFixesConfigBlock(text: string, offsets: Array<[number, number]>, recordStart: number, recordEnd: number, urls: Array<readonly string[]>) {
72 // TODO: more formal definition of URLs and delimiters

Callers 1

getDynamicThemeFixesForFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected