Open gopperman opened 9 years ago
Wait, that looks like it's working to me
(PS: Look at the article feed up top for the bug)
Could you share a link to that so I can inspect elemetn?
The problem is that the add-on runs onload, so it's gonna miss anything that gets injected into the DOM later, e.g. NYTimes, CNN, and Google all load the majority of their content with AJAX.
I think the only way to handle that ^ is to use a Mutation Observer, like:
new MutationObserver(function() {
walk(document.body);
}).observe(document.body, {
childList: true
});
I tried this locally in the console on the Google search results page and it worked!
spot on. Noah, if you commit that change, I'll repackage the plugins and update the chrome and firefox stores
I updated the content scripts for Chrome and Firefox, wanna compile 'em and test?
And you'll wanna update the Safari End Script in issue #2 too.
The Mutation Observers make a huge difference on sites like Google and CNN.
For some reason I can't quite understand yet, this still doesn't replace instances of some rich asshole in Facebook's search results.
For example, from https://www.facebook.com/search/str/donald%20trump%20some%20rich%20asshole/keywords_top:
<p>
"You have an ugly soul, Mr. Perkins, and you wrote some very ugly words meant to further
separate you from the rest of us plebes. The world can handle
<span class="highlightNode">asshole</span> <span class="highlightNode">rich</span>
guys. Look at <span class="highlightNode">Donald Trump</span>. That guy is such a
fucking train wreck we invite him into pop culture just to laugh at him some more. But
even <span class="highlightNode">Donald Trump</span>, the world’s richest birther
dumbass, would never think to say he or his golfing buddies were being treated like
victims of the Holocaust.
</p>
I wonder why that .highlightNode
isn't getting updated ...
NY Times: