/*
* @title ytchat
* @description open chatting window/tab
* @include https://www.youtube.com/*
* @include https://m.youtube.com/*
* @include https://www.youtube-nocookie.com/*
* @license MIT License https://opensource.org/licenses/MIT
* @author noromanba https://noromanba.github.io
* @javascript_url
*/
// e.g.
// https://m.youtube.com/playlist?list=PLU12uITxBEPH-v3cHoNvURjai8QqZqcxh
// https://m.youtube.com/playlist?list=PLU12uITxBEPHOJO1FU8qll6gQmKcXp5S7
(() => {
'use strict';
const url = new URL(location.href);
// TBD optional chaning
const id = url.searchParams.get('v') ||
// /embed/VIDEO_ID/
url.pathname.split('/').filter(s => !!s).pop();
if (!id) return;
const chat = `https://www.youtube.com/live_chat?is_popout=1&v=${id}`;
window.open(chat);
})();
/* from *dumb* phone */