Advertisement
Farbjodr

Twitch doubleclick

Dec 15th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Twitch doubleclick
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  Add doubleclick listener to switch to full screen
  6. // @author       Ravana
  7. // @match        https://www.twitch.tv/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.     var init = function(){
  14.         console.log("init attempt");
  15.         document.getElementsByClassName("player-video")[0].addEventListener("dblclick", function(){
  16.             document.getElementsByClassName("qa-fullscreen-button")[0].click();
  17.         });
  18.  
  19.         clearInterval(interval);
  20.         console.log("init success");
  21.     };
  22.  
  23.     var interval = setInterval(init, 1000);
  24. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement