Disney toggle play/pause

Allows you to play/pause disney plus by pressing `space` on your keyboard

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Disney toggle play/pause
// @namespace   urn://https://www.georgegillams.co.uk/greasemonkey/disney_plus_play_pause
// @include     *disneyplus.com*
// @exclude     none
// @version     2
// @description:en	Allows you to play/pause disney plus by pressing `space` on your keyboard
// @grant    		none
// @description Allows you to play/pause disney plus by pressing `space` on your keyboard
// ==/UserScript==

function addListener() {
  document.addEventListener('keypress', function(event) {
    if (event.keyCode === 32) {
      document.getElementsByClassName('btm-media-client-element')[0].click();
    }
  });
}

addListener();