I have traditionally used the "Personalize" option in Google News to limit which news sources are used (e.g., "don't show articles from FooNews"). However, the personalization options don't let you completely block a news source...the best you can do is tell it to use that source "rarely" (why they don't include a "never" option is beyond me).
Firefox is my browser-of-choice, so I finally sat down to see if I could write some code to tackle the problem, but I wanted to see what my options were and what might be the best choice. Here's what I've done/learned so far:
- Option 1...filter the incoming data - I did some Googling to see if it would be possible to intercept the response data and filter out the unwanted news sources before they are ever rendered in the browser, but couldn't find any clear advice on how to do this
- Option 2...filter the data before the DOM is constructed - I started fiddling with Mutation Observers to see if I could filter out the unwanted news sources by catching and removing those nodes as the DOM was being constructed for the page
- Option 3...filter the data after the DOM is constructed - I've heard others suggest using CSS to hide the entire document body, waiting until the DOM is built, do the filtering, then unhide the modified body (I guess this trick prevents the page flicker you get from modifying the DOM after it is initially built)
My intuition says that Option 1 would be cleanest and fastest (if it is possible to do), then Option 2 if not, and finally Option 3 as a last resort. Is this true? Is there another better option I'm missing?
Aucun commentaire:
Enregistrer un commentaire