android webview夜间模式javascript代码
本人主要总结了以下三类android webview 夜间模式javascript代码。
- 修改Background属性
- 修改Background-Color属性
- 利用invert属性翻转网页颜色
修改Background属性
style=document.createElement('style');
style.setAttribute('type','text/css');
styleElem=document.getElementsByTagName('head')[0].appendChild(style);
styleElem.innerHTML='';
child=document.createTextNode('body,body * {background:#2e2e2e
!important;color:RGB(200,200,200) !important;}');
styleElem.