Skip to content

Instantly share code, notes, and snippets.

@artulloss
Last active December 3, 2020 23:32
Show Gist options
  • Save artulloss/1ee72651fc2249163ddc87b8e092d1fd to your computer and use it in GitHub Desktop.
Save artulloss/1ee72651fc2249163ddc87b8e092d1fd to your computer and use it in GitHub Desktop.
This will block the clarify box that google uses to push messages to users with on Youtube.
// ==UserScript==
// @name Remove clarify box
// @namespace https://artulloss.dev
// @version 0.1
// @description Block youtubes "clarify box"
// @author artulloss
// @match https://*.youtube.com/*
// @grant none
// @updateURL
// @license MIT
// ==/UserScript==
(function() {
'use strict';
removeClarify();
// For youtubes navigation
window.addEventListener("yt-navigate-finish", removeClarify);
})();
function removeClarify() {
// Clarify box below youtube videos
const element = document.getElementById("clarify-box");
if(element !== null) element.remove();
// Clairfy box in youtube search results
if(window.location.href.match(new RegExp("https?:\/\/www\.youtube\.com\/results\?"))) {
const elements = document.getElementsByClassName("style-scope ytd-item-section-renderer");
for(const el of elements) {
el.remove();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment