-
Notifications
You must be signed in to change notification settings - Fork 198
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
Feat bolden newly added text nodes on dynamic sites automatically #107
Conversation
sites like facebook, twitter and angular.io insert new elemnts into the dom try while a user interacts with the site which previously were not boldend resulting in all new text looking plain. This new feature now watches the dom tree for new text nodes through the observer and boldens them accordingly
also fixes #8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on this branch, and it works pretty nice!
Found a weird bug in https://duckduckgo.com/?q=youtube&t=h_&ia=web Screen.Recording.2022-06-02.at.00.14.58.mov |
This works pretty well! Facing the same bug as @X140Yu though. |
@ansh @X140Yu the duckduckgo bug exist on build 0.0.3. duckduckgo must have some implementation that inserts text into specific elements when the element has no text present in it. our mutation observer will also execute when the dom changes and looks for text nodes not in a br-span, br-bold or br-fixation and wraps any new text nodes into br-spans this then causes duckduckgo's code to assume the element has no text and reinsert the text again mostly happens when the element is hovered. i can't find a trivial fix so presently i suggest we warn users about the behaviour and keep a ticket open for it separately. |
I can replicate on build 0.0.3 too. I tried inserting a random text node next to the br span and it still inserted the text value again. so its not just looking for a text node. its actually looks like its doing some diffing of the value and if it doesnt match the state, it inserts that text node value again. very interesting problem. |
@asieduernest12 I agree let's merge this PR but keep an issue open as we research it. |
you can verify this on sites such as
youtube.com
angular.io
reactjs.com
open any of the links above and have toggle on then navigate around, new pages elements loaded dynamically should have all their text nodes bold-end.
fix #92