Merge pull request #9037 from streetwriters/fix-clipper-images

Fix loading images in clipped pages
This commit is contained in:
Ammar Ahmed
2025-12-12 11:54:11 +05:00
committed by GitHub
3 changed files with 11 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@@ -34,10 +34,7 @@ export default defineConfig({
js: "clipper.bundle.js" js: "clipper.bundle.js"
}, },
distPath: { distPath: {
root: path.resolve( root: path.resolve(__dirname, "../../apps/mobile/ios/extension.bundle")
__dirname,
"../../apps/mobile/native/ios/extension.bundle"
)
} }
} }
}); });

View File

@@ -26,9 +26,13 @@ type CloneNodeOptions = {
export function cloneNode(node: HTMLElement, options: CloneNodeOptions) { export function cloneNode(node: HTMLElement, options: CloneNodeOptions) {
node = node.cloneNode(true) as HTMLElement; node = node.cloneNode(true) as HTMLElement;
const images = node.querySelectorAll("img");
if (!options.images) { if (!options.images) {
const images = node.getElementsByTagName("img");
for (const image of images) image.remove(); for (const image of images) image.remove();
} else {
for (const image of images) {
image.src = image.currentSrc;
}
} }
if (!options.styles) { if (!options.styles) {