-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Sites like this one assume that browsers will default to a white background and set a dark font color in their CSS which then becomes illegible. I find a lot of these sites break reader mode in some weird way on top of everything else. 😅
We should detect this case and fix it.
The logic should get injected on page load (maybe in the renderer extension? maybe an electron preload? part of the hasStyles check?)
It should look something like this:
const {backgroundColor, color: rootColor} = getComputedStyle(document.body.parentElement)
if(backgroundColor === 'rgba(0, 0, 0, 0)') {
const {color} = getComputedStyle(document.querySelector('p,span') || document.body))
if(color === rootColor) {
// They didn't set a font color at all
// Inject the agregore styles into the page
} else {
// They set a color but assumed a white background
// Set the body background to `#F2F2F2`
}
}Then we should test some styles of these pages to see if it breaks. Setting the background on the body will allow for the fancy page background effects on Windows and MacOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Ready