ansh / jiffyreader.com

A Browser Extension for faster reading on ANY website!
https://www.jiffyreader.com/
GNU General Public License v3.0
3.72k stars 200 forks source link

[BUG] Visited links maintain the blue font color of a nonvisited links, screenshots in comments #207

Closed ThinkSalat closed 1 year ago

ThinkSalat commented 1 year ago

Describe the bug links have an affordance which tells you whether you've visited or not. this is standard across browsers most of the time. typically, a blue link hasn't been visited and a purple link has. It's rather arbitrary but it's understood by anyone who has used a browser before.

Many websites will have different CSS that describes links' visited and unvisited state.

Here's what google search looks like image

Here's how it should look ideally: image

Recommendation:

Find the most specific css code that alters the visited link color or style, and apply that style when applying the bionic text style.

The culprit appears to be the color applied in the following style injection: image

As you can see, all I needed to do was disabled the color: var(--saccadesColor); style attribute to address the issue.

asieduernest12 commented 1 year ago

@ThinkSalat I can confirm our code is not impacting the behaviour of browser links changing color when visited. You can confirm the behaviour by opening a link in a new tab and you will be able to see the link change color even when jiffyreader is turned on.

Let us know if anything else bothers you and we will be happy to investigate. Sorry you had to go digging in that css pile ✌🏾

ThinkSalat commented 1 year ago

Yes, a visited link changing color is not the issue! That's expected behavior. The issue is that when the style is injected onto a link that's been visited, it allows the color: var(--saccadesColor); style. However saccasdesColor is being generated, it should be taking into account whether a link is visited. Should be easy enough to just select for the closestcolor` being specified in the css

asieduernest12 commented 1 year ago

@ThinkSalat i am not sure i understand your problem, from the title of the issue you state that unvisited links should have color x , then change to some color y when they have been visited. This has been validated as being the manifested behaviour,

It is not that easy to look up the css because we dont lookup anyones css to do anything, all the styling magic happens by adding attributes the body element with different configuration values, which triggers the appropriate style effect we want, No javascript is involved with regards to actually styling the effects, Your proposed simple solution wont work because there is no js running though setting different css values on things.

Feel free to send in a pull request or proof of conccept of how you would solve this, I would be more than happy to look over it . A good place to look is the file src/styles/ContentSyles.scss

On the other hand a very simple solution is modularize the styles and only include modular styles that affect color when the alternate color options are turned on. This will only solve the issue if no one turns on the color styles, but the issue will comeback when the color styles are applied.

I am still dont see anything when color: var(--sacadesColor); is there since visited links are styled with psuedo classes if i am not mistaken or i probably am. Will check the docs later but till then ............

Let me know how it goes. PeaceGIF

asieduernest12 commented 1 year ago

@ThinkSalat modularizing the css through the scss and adding another mechanism to conditionally injected while making sure that it has not been injected again and making that also work with the monkey scripts for people that want just the functionality without the packaged extension is something we will leave to a pull request from a kind volunteer.

ThinkSalat commented 1 year ago

It's really just a matter of when the saccadesColor is being applied to open links and making sure it follows those rules. I've done a cursory glance through the codebase and can verify that this is not out of the scope of the javascript running in the project. That said I'd stopped using the project myself, as I've seen no benefit from "bionic reading" Though I'll leave my glowing google review up:) Peace out