Skip to content

Instantly share code, notes, and snippets.

@akku1139
Last active December 10, 2024 14:43
Show Gist options
  • Select an option

  • Save akku1139/29133fcecf9bbb981908fed7ab4bad5f to your computer and use it in GitHub Desktop.

Select an option

Save akku1139/29133fcecf9bbb981908fed7ab4bad5f to your computer and use it in GitHub Desktop.
Preventing music from stopping automatically on YouTube Music
// ==UserScript==
// @name No stop YouTube Music
// @namespace Violentmonkey Scripts
// @match https://music.youtube.com/*
// @grant none
// @author akku
// @description 11/22/2024, 7:29:38 PM
// @description YouTube music has been modified to detect tab transitions and stop the music.
// @run-at document-start
// ==/UserScript==
// https://gist.github.com/akku1139/29133fcecf9bbb981908fed7ab4bad5f
// https://zenn.dev/raihara3/articles/20220214_background_tab
// https://gist.github.com/lchanouha/06b51423bc60693af216ebdce37d86a8
// Sourced from: https://stackoverflow.com/questions/47660653/chrome-extension-how-to-disable-page-visibility-api
window.addEventListener("visibilitychange", (e) => {
e.stopImmediatePropagation()
}, true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment