Posted on 02/26/2018 3:18:58 AM PST by paladinkc
I've been trying to find a javascript file using grease monkey to eliminate huffington post from yahoo so it doesn't show whenever i go there for other things, the script i have calls out several different forms but it doesn't seem to work. Anyone with some actual experience more than mine that can help?
here is a copy of the script i have
setInterval(removeSpam, 2000);
function removeSpam() {
var spanTags = document.getElementsByTagName(’span’);
var spamNames = [’Huffington Post’, ‘The Huffington Post’, ‘Salon’, ‘Salon.com’, ‘Vox’, ‘Vox.com’, ‘HuffPost’ ];
var found;
for (var i = 0; i < spanTags.length; i++) {
if (contains(spamNames, spanTags[i].textContent)) {
found = spanTags[i];
parentBlock = getParent(getParent(getParent(getParent(found))));
removeAllChildren(parentBlock);
}
}
}
function getParent(o) {
return o.parentNode;
}
function contains(a, obj) {
var i = a.length;
while (i—) {
if (a[i] === obj) {
return true;
}
}
return false;
}
function removeAllChildren(o) {
while (o.firstChild) {
o.removeChild(o.firstChild);
Why the F would you EVER want to use Yahoo? It’s like Google plus a constant stream of ultra-left bloggers presented as News.
Why not block it at your router or your Hosts file? Youd see the reference on Yahoo but youd never be able to go there.
You cannot in general terms add JavaScript to a web page coming from another server. You can inject the JavaScript by creating your own page on your file system. That page would need to have a frame to host the yahoo page. Since you JavaScript would be on the parent it could overwrite the urls in the child page.
I love blocking spam sites in my hosts file. Just learned... ( : >)
You dont need to write your own javascript. You should be able to find a browser add on (chrome, firefox..) that does that for you. Even better is to not use Yahoo at all.
You can create what are called content scripts (and content styles). Content scripts have their own private JavaScript namespace but have full access to the DOM of the current page. They are basically Greasemonkey scripts, except you don't need Greasemonkey. Content scripts are a great way to consume web content on your terms, not those of the stinkin' content provider!
A typical scenario is, a website you visit often has useful content but runs an overactive ad-tech engine in the background that spins up your CPU fans and makes simple scrolling laggy. The solution? Turn off JavaScript for the site. Now everything is quiet, and the site responds instantly. Except videos don't work. Comments are not visible. In extreme cases, the site may be a blank white page.
So, to work. A little reverse engineering and content script coding can restore the essential features disabled by disabling JavaScript (JavaScript disabling does not apply to content scripts ;)), and you end up with a responsive, useful site!
Using the content script mechanism, you can also inject styles to a page. Say, there is an obnoxious navigation/ad bar stuck at the top of the screen. You can delete it, or make it scroll off normally. No JavaScript necessary. Just target it with the appropriate CSS declarations !important.
See here to get started.
Content scripts are a major part of browser extensions.
Well does anyone have a right wing news feed? Sadly, I use Google.
A right-wing NEWS FEED?
If it’s a news feed you want, maybe you’ve heard of the DRUDGE REPORT?
(OK, more libertarian than right-wing...)
Google isn’t a news feed... it’s a search engine. Now, if you want a search engine:
I don’t know enough about it to endorse it, but 4conservative.com. I use Bing; it’s politically only marginally better than Google, but at least Microsoft is more interested in selling software than heralding in our socialist-Islamofascist overlords. DuckDuckGo is the preference of most privacy freaks I know.
With the Adblock Plus browser add-on, you can block any web site just by adding the URL to Adblock Plus’ list.
IMHO, Adblock Plus is a must have. My personal list of blocked items is very long.
NoScript blocks *everything* java unless you mark it as trusted. It’s a little annoying at first, but once it’s set up it’s great.
search for a script to “remove fox news” and then alter it... as I am sure google will have it right up front for you.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.