Tagged: User JS

YouTube Ad Blocker and Annoyances Remover GreaseMonkey script updated

Blocks video ads too.

YouTube ad-blocker and annoyances remover script

This script removes ads, disables autoplay, mutes video, adds RSS support and displays all comments.

In this version, the script will

  • disable ads, including video ads. If a video ad is loaded, a new window will be opened until an ad-free video is loaded. You will have to manually close the other tabs. I am not sure how effective it is in blocking text ads, I use a ad-blocking HOSTS file and I don’t see ads most of the time.
  • pause all videos automatically. This is useful if you open multiple videos in different tabs and if they all start playing simultaneously, you will hear the biblical Tower of Babel.
  • turn off autoplay button
  • add an RSS link next to the channel name and in a LINK tag in the HEAD section of the HTML so that the browser can activate its RSS button (if available).
  • delete “recommended for you” videos
  • unhide description
  • display all comments
  • change profile link to videos page
  • change region to US. By default, YouTube pages defaults to India and all the results are tilted in favour of Indian Youtubers. The problems with the Indian Youtubers is that their videos have low-volume voice and high-volume music. By changing to US, the video results are mostly from English-speaking countries. They are not enamoured by the need to pepper their videos with loud interludes of the same copyright-free music.

The script supports Firefox-based browser up to version 36. Newer Firefox versions should use a UserAgent (UA) spoofer add-on. YouTube loads a lighter version of the YouTube page for older browsers. This script will require the GreaseMonkey add-on to be executed by the Firefox browser.

For non-YouTube pages, I have a more generic autoplay video autostopper script. It will also work on YouTube pages if the @exclude line is removed.

This browser user js is also available at
https://openuserjs.org/scripts/zomberi/YouTube_AdBlocker_N_Annoyances_Remover

Advertisements

AutoPlay Video AutoStopper GreaseMonkey Script

If you are the type of person who opens several tabs at once and reads them one by one much later, then you need this browser user script.

Many news sites have autoplay videos on all their pages. This script will automatically pause them. You can play them manually. It also mutes the videos. If the videos use custom controls, then they may not realize that the videos has been muted. You may have to click on the play and mute buttons more than once to get them working as intended.

Autoplay videos auto stopper

All videos are auto-stopped by this script

This script, by default, does not work on YouTube pages but I have a more powerful YouTube version at https://vsubhash.wordpress.com/2019/03/10/youtube-ad-blocker-and-annoyances-remover-greasemonkey-script-updated

This browser user js is also available at
https://openuserjs.org/scripts/zomberi/AutoPlay_Video_AutoStopper

How to get the silly Twitter verified status without any real verification

With this Greasemonkey script it is easy.

// ==UserScript==
// @name        Twitter Verified Status For Everyone
// @namespace   com.vsubhash.js.twitter-verified-status-for-everyone
// @include     https://twitter.com/*
// @version     1
// @grant       none
// ==/UserScript==

var oEls;
var sVerifiedHtml1 = "<span>‏</span><span class=\"UserBadges\"><span class=\"Icon Icon--verified\"><span class=\"u-hiddenVisually\">Verified account</span></span></span><span class=\"UserNameBreak\">&nbsp;</span></span>";
var sVerifiedHtml2 = "<span class=\"ProfileHeaderCard-badges\"><a href=\"/help/verified\" class=\"js-tooltip\" target=\"_blank\" title=\"Verified account\" data-placement=\"right\" rel=\"noopener\"><span class=\"Icon Icon--verified\"><span class=\"u-hiddenVisually\">Verified account</span></span></a></span>";


function addTwitterVerifiedStatus() {
	console.log("TVSFE: Changing HTML");
	oEls = document.getElementsByTagName("span");
	if (oEls.length > 0) {
		for (var i = 0; i < oEls.length; i++) {
			if (oEls[i].className) {
				if (oEls[i].className.indexOf("FullNameGroup") > -1) {
					if (oEls[i].innerHTML.indexOf("Icon Icon--verified") == -1) {
						oEls[i].innerHTML += sVerifiedHtml1;
						console.log("TVSFE: Screenname icon added");
					}
				}
			}
		}		
	}
	oEls = document.getElementsByClassName("ProfileHeaderCard-name");
	if (oEls.length > 0) {
		for (var i = 0; i < oEls.length; i++) {
			if (oEls[i].innerHTML.indexOf("ProfileHeaderCard-badges") == -1) {
				oEls[i].innerHTML += sVerifiedHtml2;
				console.log("TVSFE: Profile icon added");
			}
		}
	}	
}


function handle_DOMLoaded(aoEvent) {
	try {
		console.log("TVSFE: Page loaded");
		window.setTimeout(addTwitterVerifiedStatus, 3*1000);
		
		addTwitterVerifiedStatus();
	} catch (e) {
		console.error("TVSFE: Error - " + e);
	}
}


document.addEventListener("DOMContentLoaded", handle_DOMLoaded, false);

BloombergQuint protects its paywall using a CSS filter!!!

They are selling one-year subscription for Rs. 3000.

I mailed BloombergQuint a few days ago but they don’t care. They seem to think that even if someone figures this out, it is still a hassle to do this on all pages. I have a GreaseMonkey script that does this automatically on all their pages. Not that I read the site every day.

Open the browser’s console and disable the fuzzy container’s filter and the page’s content is visible.

BloombergQuint is one of the few remaining independent news organizations. The Quint was in the news recently when Modi govt raided their offices after some explosive Rafale deal-related stories and IT officials were found cloning the contents of journalists’ phones and computers.

It seems that their subscribers’ support is thin.

Facebook Posts Deleter updated – Greasemonkey script to delete FB posts one by one

Facebook archives all your posts, photos and videos to optical media, not just HDDs. So, when you tell them to delete your content, do they really delete it from its cold-storage system too? Unlikely. Delete Facebook, if you have one, now.

Facebook Posts Deleter 2016 was a User Script that automatically deleted Facebook posts one by one on the FB “Activity Log” page. You could use this script if you did not trust Facebook to delete the content when you choose that option on its page. One FB user, who sued Facebook, found that deleted content continues to reside on Facebook servers on its distributed content delivery network long after the account has been “deleted” by Facebook.

Like Google/YouTube, Facebook seems to be serving different set of web pages, CSS & JS for different versions of web browsers. This User JavaScript was developed and tested in Firefox 34. Spoof this version with a Firefox add-on. The code is now very simple. There is no start button. It will start deleting posts without warning.

Greasemonkey script to click the “Load More” button of YouTube video pages

YouTube forces its content creators to create lots of videos than is necessary. I have been watching the drawing videos of an artist. She is now posting videos every day, not about drawing but about her everyday activities. In these videos, she posts links to the real drawing videos or tells about them in advance. It’s awful. She is not alone. There are lots of people who seem to be doing this. There was this one guy whose electronics videos I watched a few times. I decided to check what else he had posted. Yikes! A whole lot of useless nothingness videos! I didn’t see them earlier because I always change the filter to “Most popular”.

If content creators stop making such videos, YouTube lets their earnings fall. This is because only the latest videos of subscribed channels are listed when people launch the YouTube app. If a content creator does not produce at least two or three videos per week, it is easy to get hidden by other channels when he/she does release a new video after a long break.

I use bookmarks and the hidden RSS feeds of YouTube. I don’t login and I don’t watch them live. Because of unexplained lag issues, I download the videos and watch them offline on my WDTV device.

When I check the videos pages, only some video thumbnails are listed there. There is a “Load More” button, which needs to be clicked several times to get the full listing. Sometimes the Net connection breaks during this interval and the expansion of the page stops. I need to then refresh the page and then click the button a few times to get to down to where I was. So, I wrote this Greasemonkey script to that for me. I load the video page and the script automatically clicks the button several times, waiting for sometime between each click to let the videos thumbnails.

With this script, I open the videos page to let it roll out. Meanwhile, I browse some other page. By the time I come back to the video page, all the thumbnails are listed.

Greasemonkey JavaScript-based YouTube adblocker and annoyances remover

Watching YouTube online is still impossible for me – the Net connection is still flaky and there are disturbances in the electricity supply. Downloading the videos and playing them offline is still the only option for me. Even then, the YouTube comes with a great deal of annoyances – ads (text and video), autoplay, “Recommended for you” video list, lack of RSS feeds, half-hidden description, YouTube-curated (or censored) “Top Comments”.

I have created several Greasemonkey scripts to deal with YouTube. Recently, I added a few more. Here they are:

The last one is new. It does several things – disables video ads, hides text ads, disables autoplay, deletes “recommended for you” ads.

Disabling video ads was tricky. The current implementation opens the same video URL in another tab and closes the current tab. This is repeated until YouTube relents and loads the original video. This can range anywhere from 2 to 10 reloads, probably. The code also finds the mute button and mutes the ad.

NOTE: I use an old version of Firefox and I spoof a newer but still old version in it. YouTube and other Google sites serve different styles of pages for different browser versions. The above code works with Firefox 42. To make the code work, you can spoof version 42 using the UserAgent Switcher add-on with this UA string.

Mozilla/5.0 (Windows NT 6.2; rv:42) Gecko/20100101 Firefox/42.0

Of course, I will not be publishing the ad-blocking code. YouTube apocalypse is on now. Ad agencies have done to YouTube what they had been doing for decades to newspaper and TV journalism – interfering in content. After CNN decided to launch a crusade against Alex Jones’ YouTube channels, ad agencies are now telling YouTube that their ads should not be playing on “controversial” content. The bottomline now is that videos from big music labels and stars can have all kind of crude/vulgar/unsuitable content but ordinary folk stepping out of the line will have to be immediately “demonetized.” I found one retired nurse, who publishes makeup tutorials, complaining that she never said a bad word or anything controversial but all her videos were demonetized.

Until the said apocalypse, YouTube content creators seem to have been generously paid. When the times were good, YouTube went all over the world asking people to make videos and make tons of money. Now, YouTube’s revenues are down and the first victims are the small and independent content creators who took YouTube’s bait. A million page views earns the creators very little. It is only with off-YouTube marketing deals and paid-promotion that YouTube content creators can make money. I am surprised that that many seemingly intelligent people left their day jobs and became “Youtubers” full time. Even more sad are the legion of retired folks whose savings have been destroyed by Bush and Obama’s zero-interest monetary regime and free-trade policies, and Wall Street’s looting of pension funds and local government funds. There can be no economy without local manufacturing. Selfies and cat videos are not what an advanced economy runs on.

Anyway, I can tolerate text ads. The videos ads are horrible. The “recommended for you” videos are downright creepy. Why are they recommended for me?

Greasemonkey script to display newer comments on YouTube – bypass censorship

Changes comments filter to “Newest first” from “Top comments”

YouTube has been raining on the parade of its content creators with demonetization, censorship and unexplained notifications disablement. Youtube comments are also being censored. The default filter is not “Newest first” or “Oldest first” but “Top comments”. Trolls will eventually game the system. I would rather see unfiltered comments. So, here it is:

A GreaseMonkey script to generate RSS feed links for YouTube channels

Many people use RSS feeds as the primary means to access news and information. RSS is anonymous and does not require you to log in.

Though YouTube generates RSS feeds for its channels, it does not display them (to human visitors) or advertise them (to browser software). If you prefer to subscribe to YouTube videos via RSS, then you have to manually construct the the feed URL for each channel.

I decided to automate the task using this Greasemonkey script. A few seconds after a YouTube video page gets loaded, the Greasemonkey Javascript adds an RSS icon image next to the channel name. The script links the image to the RSS feed of the YouTube channel. (This RSS icon image works seamlessly as it is from Google and is used in its “News” pages.) The Greasemonkey script also adds an RSS link tag to the HTML HEAD section so that browser applications can activate their RSS feed toolbar button.

A YouTube channel listing in the Bamboo RSS feed reader (a Firefox add-on or extension).

RSS provides an easier way to check Youtube channels. All that matters to YouTube is that people see their ads. RSS does not block ads and so no problem. Viewers who rely on subscriptions are likely to miss new but not so fresh videos if they don’t log in regularly. (Such videos get folded/wrapped/hidden as newer videos are published.) YouTube RSS feeds can ensure that viewers are more likely to get to know about the existence of a new video.

And, to use this script, you will need the Greasemonkey add-on in the browser. It can be installed from the Firefox/Seamonkey browser add-on search page (Tools – Add-ons from the main menu).

This article has been submitted to .