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

shadowDOM 的裁剪问题 #187

Closed
mika-cn opened this issue Jun 16, 2021 · 0 comments
Closed

shadowDOM 的裁剪问题 #187

mika-cn opened this issue Jun 16, 2021 · 0 comments

Comments

@mika-cn
Copy link
Owner

mika-cn commented Jun 16, 2021

问题

shadowDom 很难保存

可能的方法

  • 对 shadowDOM 进行序列化,在裁剪下来的网页中用 JS 重新构建 shadowDOM。不过这违背了我们不保存 JS 的初衷,虽然这段 JS 是由我们自己写的,可保证其安全性,但如果用户使用的浏览器禁用了 JS,这些 shadowDOM 无法正常渲染。

  • Declarative Shadow DOM。这个可以用纯 HTML 来表示 shadowDOM,但是这个还没达到标准,现在的浏览器似乎只有 Chrome 90 支持并默认启用。

https://web.dev/declarative-shadow-dom/
https://github.com/mozilla/standards-positions/issues/335
@mika-cn mika-cn closed this as completed Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant