Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excessive memory/volume consumption for constructed stylesheets shared among shadow DOMs #1514

Open
danny0838 opened this issue Jul 25, 2024 · 5 comments

Comments

@danny0838
Copy link

danny0838 commented Jul 25, 2024

Describe the bug
Constructed stylesheets shared among shadow DOMs are duplicated in each HTML representation of shadow DOM during saving a page, causing excessive memory/volume consumption.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a thread with many comments under Reddit, e.g. this thread
  2. Scroll down and click "View more comments" for around 10+ times.
  3. Capture the page with SingleFile.

Expected behavior
The page should be captured normally. Actually the browser is very likely to crash during the capture due to memory exhaustion.

Environment

  • OS: Win10 (probably independent)
  • Browser: Chrome 126 and Firefox 128 (probably independent)
  • Version: 1.22.54

Additional context
See related thread in Stack Exchange

@danny0838 danny0838 changed the title Memory exhausted due to constructed stylesheets shared among shadow DOMs Excessive memory/volume consumption for constructed stylesheets shared among shadow DOMs Jul 25, 2024
@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jul 25, 2024

Thank you, it's a duplicate of #1387

@gildas-lormeau
Copy link
Owner

I think I should be able to find a solution at least for self-extracting or ZIP files to de-duplicate stylesheets. I'll try to figure out how to implement this approach.

@gildas-lormeau

This comment was marked as off-topic.

@gildas-lormeau
Copy link
Owner

For the record, this issue is due to WICG/webcomponents#939.

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Sep 9, 2024

The size of saved pages on Reddit can be significantly reduced by enabling the option Stylesheets > group duplicate stylesheets together when saving pages in the HTML format. Formats based on ZIP use this optimization without needing to enable this option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants