Youtube No Resume

当前为 2018-04-09 提交的版本,查看 最新版本

// ==UserScript==
// @name        Youtube No Resume
// @match       *://*.youtube.com/watch?*
// @run-at      document-start
// @grant       none
// @description:en Disables the resume feature in Youtube.
// @version 0.0.1.20180409213303
// @namespace https://greasyfork.org/users/179175
// ==/UserScript==
function TestUrl() {
var href = window.location.href;
if (href.search("&t=") != "-1") {
    if (href.search("&t=1ms") == "-1") {
    window.location.replace(href.substr(0,href.lastIndexOf('&')) + "&t=1ms");
    }
}
}
var fireOnHashChangesToo    = true;
var pageURLCheckTimer       = setInterval (
    function () {
        if (   this.lastPathStr  !== location.pathname
            || this.lastQueryStr !== location.search
            || (fireOnHashChangesToo && this.lastHashStr !== location.hash)
        ) {
            this.lastPathStr  = location.pathname;
            this.lastQueryStr = location.search;
            this.lastHashStr  = location.hash;
            TestUrl();
        }
    }
    , 111
);
TestUrl();