MCPcopy
hub / github.com/darkreader/darkreader / getCSSBaseBath

Function getCSSBaseBath

src/inject/dynamic-theme/css-rules.ts:152–155  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

150}
151
152export function getCSSBaseBath(url: string): string {
153 const cssURL = parseURL(url);
154 return `${cssURL.origin}${cssURL.pathname.replace(/\?.*$/, '').replace(/(\/)([^\/]+)$/i, '$1')}`;
155}
156
157export function replaceCSSRelativeURLsWithAbsolute($css: string, cssBasePath: string): string {
158 return $css.replace(cssURLRegex, (match) => {

Callers 3

getURLModifierFunction · 0.90
getRulesAsyncFunction · 0.90
replaceCSSImportsFunction · 0.90

Calls 1

parseURLFunction · 0.90

Tested by

no test coverage detected