|
|
@@ -85,10 +85,11 @@ struct WebIndex{
|
|
|
})
|
|
|
.width("100%")
|
|
|
.height("100%")
|
|
|
- .domStorageAccess(true)
|
|
|
+ // .domStorageAccess(true)
|
|
|
.margin({bottom:20})
|
|
|
- .backgroundColor(this.isDarkMode ? 0x1A1A1A : 0xFFFFFF)
|
|
|
+ // .backgroundColor(this.isDarkMode ? 0x1A1A1A : 0xFFFFFF)
|
|
|
.darkMode(this.isDarkMode ? WebDarkMode.On : WebDarkMode.Off)
|
|
|
+ .forceDarkAccess(this.isDarkMode)
|
|
|
// .textZoom(100)
|
|
|
.onProgressChange((event)=>{
|
|
|
if (event) {
|
|
|
@@ -96,27 +97,6 @@ struct WebIndex{
|
|
|
this.progressValue = event.newProgress
|
|
|
}
|
|
|
})
|
|
|
- .onPageEnd(() => {
|
|
|
- if (this.isDarkMode) {
|
|
|
- this.webController.runJavaScript(`
|
|
|
- document.body.style.color = '#FFFFFF';
|
|
|
- document.body.style.backgroundColor = '#1A1A1A';
|
|
|
- document.querySelectorAll('*').forEach(element => {
|
|
|
- element.style.color = '#FFFFFF';
|
|
|
- if (element.tagName === 'A') {
|
|
|
- element.style.color = '#1E90FF';
|
|
|
- }
|
|
|
- });
|
|
|
- const style = document.createElement('style');
|
|
|
- style.textContent = \`
|
|
|
- body { color: #FFFFFF !important; background-color: #1A1A1A !important; }
|
|
|
- p, div, span, h1, h2, h3, h4, h5, h6 { color: #FFFFFF !important; }
|
|
|
- a { color: #1E90FF !important; }
|
|
|
- \`;
|
|
|
- document.head.appendChild(style);
|
|
|
- `);
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|