image-exporter 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3396,13 +3396,6 @@ async function proxyCSS(config) {
|
|
|
3396
3396
|
try {
|
|
3397
3397
|
const response = await fetch(proxiedURL);
|
|
3398
3398
|
let cssContent = await response.text();
|
|
3399
|
-
cssContent = cssContent.replace(
|
|
3400
|
-
/url\(['"]?(https?:\/\/[^'")\s]+)['"]?\)/g,
|
|
3401
|
-
(match, url) => {
|
|
3402
|
-
if (url.startsWith(config.corsProxyBaseUrl)) return match;
|
|
3403
|
-
return `url("${config.corsProxyBaseUrl}${encodeURIComponent(url)}")`;
|
|
3404
|
-
}
|
|
3405
|
-
);
|
|
3406
3399
|
const styleElement = document.createElement("style");
|
|
3407
3400
|
styleElement.textContent = cssContent;
|
|
3408
3401
|
styleElement.setAttribute(
|
|
@@ -3401,13 +3401,6 @@
|
|
|
3401
3401
|
try {
|
|
3402
3402
|
const response = await fetch(proxiedURL);
|
|
3403
3403
|
let cssContent = await response.text();
|
|
3404
|
-
cssContent = cssContent.replace(
|
|
3405
|
-
/url\(['"]?(https?:\/\/[^'")\s]+)['"]?\)/g,
|
|
3406
|
-
(match, url) => {
|
|
3407
|
-
if (url.startsWith(config.corsProxyBaseUrl)) return match;
|
|
3408
|
-
return `url("${config.corsProxyBaseUrl}${encodeURIComponent(url)}")`;
|
|
3409
|
-
}
|
|
3410
|
-
);
|
|
3411
3404
|
const styleElement = document.createElement("style");
|
|
3412
3405
|
styleElement.textContent = cssContent;
|
|
3413
3406
|
styleElement.setAttribute(
|
package/package.json
CHANGED
|
@@ -29,17 +29,6 @@ export async function proxyCSS(config: Config) {
|
|
|
29
29
|
const response = await fetch(proxiedURL);
|
|
30
30
|
let cssContent = await response.text();
|
|
31
31
|
|
|
32
|
-
// Proxy absolute URLs (http/https) within the CSS content
|
|
33
|
-
cssContent = cssContent.replace(
|
|
34
|
-
/url\(['"]?(https?:\/\/[^'")\s]+)['"]?\)/g,
|
|
35
|
-
(match, url) => {
|
|
36
|
-
// Skip if already proxied
|
|
37
|
-
if (url.startsWith(config.corsProxyBaseUrl)) return match;
|
|
38
|
-
// Otherwise return proxied URL
|
|
39
|
-
return `url("${config.corsProxyBaseUrl}${encodeURIComponent(url)}")`;
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
|
|
43
32
|
// Insert the parsed CSS content into a <style> element
|
|
44
33
|
const styleElement = document.createElement("style");
|
|
45
34
|
styleElement.textContent = cssContent;
|