Delay removal Moonwalk

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

  1. // ==UserScript==
  2. // @name Delay removal Moonwalk
  3. // @namespace play once
  4. // @description отключение задержки перед воспроизведением
  5. // @match *://*/*
  6. // @version 1.3
  7. // @run-at document-start
  8. // @grant unsafeWindow
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. var w = unsafeWindow || window,
  13. inIFrame = function() {
  14. try {
  15. return w.self !== w.top;
  16. } catch (e) {
  17. return true;
  18. }
  19. };
  20.  
  21. if (!inIFrame)
  22. return;
  23.  
  24. function playonce() {
  25. if (typeof delay !== undefined)
  26. delay=0;
  27. }
  28.  
  29. window.addEventListener('load',function() {
  30. if (w.condition_detected !== undefined) {
  31. w.request_host_id = "19804";
  32. var player = document.getElementById('player');
  33. if (player) player.onclick = function(){
  34. w.showVideo();
  35. };
  36. }
  37. },false);
  38. })();