Delay removal Moonwalk

отключение задержки перед воспроизведением

目前为 2016-04-17 提交的版本。查看 最新版本

// ==UserScript==
// @name Delay removal Moonwalk
// @namespace play once
// @description отключение задержки перед воспроизведением
// @match *://*/*
// @version 1.1
// @run-at document-start
// @grant unsafeWindow
// ==/UserScript==

(function () {
    var w = unsafeWindow || window,
        inIFrame = function() {
            try {
                return w.self !== w.top;
            } catch (e) {
                return true;
            }
        };

    if (!inIFrame)
        return;

    function playonce() {
        if (typeof delay !== undefined)
            delay=0;
    }

    w.addEventListener('load',function() {
        if (typeof condition_detected !== undefined) {
            playonce();
            var player = document.getElementById('player');
            if (player) player.onclick=function(){
                playonce();
                showVideo();
            };
        }
    },false);
})();