// ==UserScript==
// @name Will you watch til the end?
// @namespace blind-youtube
// @version 0.1
// @description Youtube videos with no indication of how long they are
// @author Maggie
// @match *://*.youtube.com/*
// @include *://*.youtube.com/*
// @grant none
// @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
// ==/UserScript==
// ** 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
// 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(‘span.ytp-time-current, span.ytp-time-duration, span.video-time’, function(e) { hidetime(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 hidetime(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
// Your code here…
})();