DGG - Add close stream button

2024-10-03, tfw you learn javashit to do Jaydr's job

目前為 2024-10-03 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        DGG - Add close stream button
// @namespace   Jaydr do your job
// @match       https://www.destiny.gg/bigscreen
// @match       https://www.destiny.gg/bigscreen*
// @match       https://www.destiny.gg/embed/chat
// @match       https://www.omniliberal.dev/bigscreen
// @match       https://www.omniliberal.dev/bigscreen*
// @match       https://www.omniliberal.dev/embed/chat
// @grant       none
// @version     0.1
// @author      mif
// @license     MIT
// @description 2024-10-03, tfw you learn javashit to do Jaydr's job
// ==/UserScript==

function scuffed_function() { // idk how to do events so I'm clicking the other button
  document.getElementById("close-embed-btn").click()
}

let target_element = document.querySelector('#theater-mode') // set a base element to attach to (CINEMA one)
let custom_close_embed_button = document.createElement("button") // making the new button

// configuring the new button
// custom_close_embed_button.id = "close-embed-custom"; // useless
custom_close_embed_button.textContent = "❌ Embed"; // name the button
custom_close_embed_button.style = "color:teal!important"; // make it distinct
custom_close_embed_button.addEventListener("click", scuffed_function, false); // can't copy the initial listner so target the other button


target_element.after(custom_close_embed_button); // actually add the button after target_element
target_element.textContent = "🎥 Mode"; // text too long, make this one shorter also