Skip to content

Instantly share code, notes, and snippets.

@Pepijn98
Last active October 18, 2020 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pepijn98/9c2f6eed61ec68f399022237d640406c to your computer and use it in GitHub Desktop.
Save Pepijn98/9c2f6eed61ec68f399022237d640406c to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name YTLC Auto Switch
// @namespace ytlc-auto-switch
// @version 1.0.2
// @description Just auto switches to live chat instead of top chat
// @author Pepijn98
// @match https://www.youtube.com/*
// @grant none
// @homepageURL https://github.com/Pepijn98
// @supportURL https://github.com/Pepijn98
// @updateURL https://gist.githubusercontent.com/Pepijn98/9c2f6eed61ec68f399022237d640406c/raw/YTLC-AutoSwitch.meta.js
// @downloadURL https://gist.githubusercontent.com/Pepijn98/9c2f6eed61ec68f399022237d640406c/raw/YTLC-AutoSwitch.user.js
// @run-at document-idle
// ==/UserScript==
// ==UserScript==
// @name YTLC Auto Switch
// @namespace ytlc-auto-switch
// @version 1.0.2
// @description Just auto switches to live chat instead of top chat
// @author Pepijn98
// @match https://www.youtube.com/*
// @grant none
// @homepageURL https://github.com/Pepijn98
// @supportURL https://github.com/Pepijn98
// @updateURL https://gist.githubusercontent.com/Pepijn98/9c2f6eed61ec68f399022237d640406c/raw/YTLC-AutoSwitch.meta.js
// @downloadURL https://gist.githubusercontent.com/Pepijn98/9c2f6eed61ec68f399022237d640406c/raw/YTLC-AutoSwitch.user.js
// @run-at document-idle
// ==/UserScript==
(function() {
'use strict';
var elements = document.getElementsByTagName("yt-live-chat-app");
if (elements.length >= 1) {
var btn = document.querySelector("a[class='yt-simple-endpoint style-scope yt-dropdown-menu']");
if (btn) btn.click();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment