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

开启Dark mode后,进入页面会闪烁一下 #787

Open
BugKun opened this issue Nov 5, 2020 · 2 comments
Open

开启Dark mode后,进入页面会闪烁一下 #787

BugKun opened this issue Nov 5, 2020 · 2 comments

Comments

@BugKun
Copy link

BugKun commented Nov 5, 2020

开启Dark mode后,进入页面会闪烁一下。感觉可以在document-start的时候把css先插入进去,这样就不会有闪烁的问题了。

@jjj201200
Copy link
Member

jjj201200 commented Nov 5, 2020

如果是采用原生js进行style注入的话应该是可行的,但现在不是。
@carltonf 可以考虑考虑可行方案,不一定要立马落实。

比如可以用原生js和css进行css夜间模式的样式初始化,在页面加载时加这一个步骤,然后darkMode样式再覆盖上去,就不会闪烁了。chrome.tabs.insertCSS 或许是有用的接口

@BugKun
Copy link
Author

BugKun commented Nov 5, 2020

具体可以参考Tampermonkey和stylus(stylish)的实现方式,这两个加载自定义css都不会闪烁

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