-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Manually assigned slots not correctly preserved #1526
Comments
Are you suggesting to add a non-standard I do not see it here: https://html.spec.whatwg.org/#the-template-element (I just discovered the declarative shadow DOM has been merged into the spec. BTW). If it's not standard, it should be at least prefixed to avoid potential forward compatibility issues (Mootools, I haven't forgotten you). I was not aware that other |
No, it's for making test cases only and I'm not suggesting anything. Actually it will never work even used, since Currently WebScrapBook handles shadow DOM related things with scripts, mostly for historical reasons because it's so recently that I know of the declarative shadow DOMs. Actually I'm investigating whether to switch to HTMLifying or add as another option. Though, it seems tricky to HTMLify manually assigned slots. A reasonable strategy is probably to forget the slotAssignment property and rewrite the slot attribute of each slottables. For a non-assigned slottable, maybe assign a new random unused string? But assigning slot attribute doesn't work for a slottable text node, it may be required to rewrite it as a span element, with a risk of breaking the page layout. HTMLifying with declarative shadow DOMs may also introduce a potential compatibility issue for older browsers. As the code comment in the OP says, if a browser supports BTW, do you have a test suite for page saving? |
Supporting this property as part of SingleFile seems tedious as you described it, I'll have to think about it for a while too... Thanks again for creating this issue which will allow me to dive into this problem at any time. By the way, I've just seen that In fact, historically, SingleFile was more or less a hack for Chrome because it did not support the MHTML format. I've always seen it as a "fun" project, so I don't have a test suite. It has also become a lot more popular than I thought initially. In practice, I fix a lot of bugs/regressions, but it's still fun and plenty of surprises :) (It's good for the memory too). In practice, I often use the examples on the MDN pages for quick tests (e.g. the |
I don't find Although Chrome supports MHTML now, I don't really like it. It's too difficult to write a script to analyze or convert. It's not UTF-8 encoded and all Asian texts are encoded and it's difficult to even perform a naive plain text search in the source code. Let alone that built-in module for page saving is too weak to handle so many things, for both html (+supporting folder) or mhtml. MAFF is so far the most promising format for single page archiving but unfortunately no browser vendor is active to support it. I don't think it's really so difficult to implement by e.g. extending the module that handles the jar: protocol in Firefox or extending the zipped extension handling mechanism in Chromium... WSB has been having a test suite to systematically verify many capture cases since 7 years ago. I personally find it helpful for code refactoring, regression prevention, and dealing with browser compatibility issues. The test cases can be either tested with an automated script or by manually opening in the browser and seeing whether it looks identical after a capture. Actually the recently reported issues are mostly come from it (e.g. manual slots, form, adopted stylesheets, namespace). Additionally I have still seen several cases that are not handled appropriately by SF, but will probably be too lazy to recheck and report all of them. Just FYI, You can test them on your own if you're interested in. |
You're right, I'm not a fan of MHTML either, I thought it would have caught on anyway when Google implemented it in Chrome. I agree that the MAFF/ZIP format seems to be the simplest and most suitable for saving web pages. The self-extracting format in SingleFile is quite similar actually, it's a zip file and it's supported in all browsers (since I managed to get around the need to rely on I also agree that a test suite is really desirable in this kind of project. I'm very grateful for your permission to use yours. I'll have to take a look. I guess it could be relatively easy to run them automatically with SingleFile CLI. |
Describe the bug
The status of manually assigned slots is not correctly preserved in the captured page.
Manually assigned slots is supported since Chromium 86 and Firefox 92. I have seem websites using slot elements but not sure whether this feature is used in a real world site or not.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The captured page should show:
as in the original page.
Environment
The text was updated successfully, but these errors were encountered: