Last active
December 3, 2020 23:32
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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