Project 4: BEGONE!

// ** CHANGE @NAME, @NAMESPACE, and @DESCRIPTION
//
// ** If using for Tampermonkey, you can just paste this into
// ** the Tampermonkey editor
//
// ** If using for Chrome, CHANGE FIRST PART OF FILENAME
// ** (before the .user.js) and edit in a code editor like Atom
//
// ** EVERYTHING BETWEEN ==UserScript== lines is read by the browser
//    as configuration information for the userscript
//
// ==UserScript==
// @name NO MORE CLICKBAIT
// @version 1.0
// @namespace chaseisgod.com
// @description demonstrates a userscript method for altering websites
// @require http://arts445.courses.bengrosser.com/files/ready-vanilla.js
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @run-at document-start
//
// **WRITE MATCH STATEMENTS TO MATCH WEBSITE URLS (FOLLOW MY EXAMPLE)
//
// @match *://*.youtubecom/*
// @include *://*.youtube.com/*
//
// ==/UserScript==// -----------------------------------------
//
//
//
//
// Basic Userscript Template
//
// This code demonstrates a general method for creating browser Usercripts
// that utilize jQuery to modify pages, whether static or dynamic. This
// can be used in Tampermonkey (which is how we'll start), or later,
// in Chrome extensions.
//
// written by grosser for ARTS 445: Net Art, sp '18



// this line (and the last one in the file) open and close
// an 'immediate invoked function', which keeps our
// code separate from other code running on the website
// just leave it here
(function() {

// jQuery on 'j' to avoid conflicts with page jQuery
var j;

// PUT YOUR CODE within main() below
function main() {

    // setup jQuery on j to avoid any possible conflicts
    j = jQuery.noConflict();

    // outlines all existing <a> tags in red
    // running .each() on a jQuery search executes the included function
    // individually for each element it finds that matches the search
    // (e.g. in this case, it runs the function redBorder() for each 'a'
    // tag). the parameter name 'e' refers to the found element
    //
    // j('a').each(function() { redBorder(this); });

    // this line sets up a continuous search for new elements on the
    // page that might get inserted later. so, in this example, any
    // HTML with an 'a' tag that gets inserted *after* the page loads
    // will call redBorder() for each one in turn. this way you can
    // catch and change anything that happens after the page load
    // (e.g. a new news feed story on the Facebook newsfeed0
    ready('.style-scope .yt-img-shadow', function(e) {hideElement (e); });
    ready('span', function(e) {hideElement (e); });
    ready('yt-formatted-string', function(e) {hideElement (e); });
    // this function could do anything with the results it receives
    // 'jnode' refers to the jquery object the initial jQuery search
    // found, so we refer to it and then continue on with familiar
    // jQuery statements
    function hideElement(e) {
        j(e).hide();
    }
}


// run the main function
main();

// utility functions we'll use during the semester
// are below. for now it's just another version of
// contains we can use to test string content

// cleaner syntax than match()
    String.prototype.contains = function(it) { return this.indexOf(it) != -1; };


// close the opening invoked function
})();

In this project I got rid of all thumbnails for videos to get rid of clickbait videos that just want to trick you into watching something that you didn’t really want to watch. Also I got rid of the “trending” video texts and other things that try to push you into watching certain types of videos. This usually leads to a monopolization of views and likes because of people not knowing what they’re getting into because youtube and channels work together to put them in a situation they did not ask for. No More Clickbait makes it so you don’t have to worry about being visually tricked.

Comments are closed.