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

在刷新加载时,化学符号链接出现 从浏览器默认样式到CSS样式 的transition动画 #15

Closed
Nyaasu66 opened this issue Feb 13, 2020 · 2 comments

Comments

@Nyaasu66
Copy link

Nyaasu66 commented Feb 13, 2020

问题描述:

如图所示

aboutme-flash-bug

在点击刷新后,页面样式会出现 从浏览器默认的a标签字体的蓝色,到CSS设定的白色的变化
CSS: .chem-element { transition-duration: 0.5s; }

解决方法

在 stack overflow 上找到了一样的问题 Stop CSS transition from firing on page load

本质上是Chrome的 Bug , 但是可以自行解决

在删除 meta 标签的 CSP策略 “ default-src 'none'; 后
在 </ body> 标签前添加一对空script标签 <script> </script> 即可完美解决.

基于作者你应该是基于避免网站被攻击的考虑,而禁用外部资源加载,故没有提Pull Request,你可以酌情考虑这个问题,这里提一个Issuse只是一个微不足道的小提示

@amphineko
Copy link
Owner

鉴于这个 bug 是由 Chrome 导致,而且持续了多年也没有修复,我决定不使用这个 trick 来绕过。
不过还是多谢你提交这个 issue,我是第一次见到这个 bug。

基于作者你应该是基于避免网站被攻击的考虑,而禁用外部资源加载

不仅是在 HTML 里,我在 Web 服务器上也默认在 HTTP 头部里插入了 CSP。

@amphineko
Copy link
Owner

在删除 meta 标签的 CSP策略 “ default-src 'none'; 后
在 </ body> 标签前添加一对空script标签 <script> </script> 即可完美解决.

我会考虑把你的建议写在 README 里,供有需要的人自行斟酌。

amphineko added a commit that referenced this issue Feb 14, 2020
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