Closed You-Honey closed 3 months ago
Describe the bug When using the extension and saving a website everything works perfect.
When I inject the lib/single-file.js to the webpage and run either:
lib/single-file.js
const { content, title, filename } = await singlefile.getPageData({ removeHiddenElements: true, removeUnusedStyles: true, removeUnusedFonts: true, removeImports: true, blockScripts: true, blockAudios: true, blockVideos: true, compressHTML: true, removeAlternativeFonts: true, removeAlternativeMedias: true, removeAlternativeImages: true, groupDuplicateImages: true });
Or
const { content, title, filename } = await singlefile.getPageData({ removeHiddenElements: false, removeUnusedStyles: false, removeUnusedFonts: false, removeImports: false, blockScripts: false, blockAudios: false, blockVideos: false, compressHTML: false, removeAlternativeFonts: false, removeAlternativeMedias: false, removeAlternativeImages: false, groupDuplicateImages: false });
Everything works almost perfectly but the website's responsiveness changes.
Additional context I did the test with my own browser but the use case will be run inside Playwright.
So the question is, if I install the extension to my Playwrights' browser, can I run the extension programmatically somehow?
I could simulate they hotkey to run it but I have no idea how to handle the download prompt.
Is there a way to run the extension from the console?
Cheers!
You can use SingleFile CLI, there is an implementation for playwright, see https://github.com/gildas-lormeau/single-file-cli/blob/master/back-ends/playwright-chromium.js.
This is interesting, thank you!
Describe the bug When using the extension and saving a website everything works perfect.
When I inject the
lib/single-file.js
to the webpage and run either:Or
Everything works almost perfectly but the website's responsiveness changes.
Additional context I did the test with my own browser but the use case will be run inside Playwright.
So the question is, if I install the extension to my Playwrights' browser, can I run the extension programmatically somehow?
I could simulate they hotkey to run it but I have no idea how to handle the download prompt.
Is there a way to run the extension from the console?
Cheers!