rgunti / YouTube New Tab SubBox

// ==UserScript==
// @icon         https://youtube.com/favicon.ico
// @name         YouTube New Tab SubBox
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Opens Videos in your Subscription Box in a new Tab
// @author       rGunti
// @match        https://www.youtube.com/feed/subscription
// @grant        none
// @require      https://code.jquery.com/jquery-latest.js
// ==/UserScript==
/* jshint -W097 */
'use strict';

$(document).ready(function() {
    console.log("[yt_nts] Initializing...");
    window.setInterval(function() {
        $("a[href^='/watch']").click(function(e) {
            console.log("[yt_nts] Click Event raised: " + e.target.href, e);

            var newVideoTab = window.open(e.target._href, '_blank');
            if (newVideoTab) newVideoTab.focus();
            else alert('Please allow popups for this site');

            return false;
        }).each(function(i) {
            console.log("[yt_nts] Object " + i + ":", this, this.href);
            this._href = this.href;
            this.href = "#";
        });
    }, 1000);
});