您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
24/02/2025, 21:06:45 Hacky solution to embed full kick site instead of the embed. I can't promise it will continue to work indefinitely. If it bugs out when resizing the window, try refreshing the page.
当前为
- // ==UserScript==
- // @name Better DGG Kick Embed
- // @namespace yuniDev.kickembed
- // @match https://kick.com/*
- // @match https://www.destiny.gg/bigscreen
- // @match https://destiny.gg/bigscreen
- // @grant none
- // @version 1.0
- // @author yuniDev
- // @license MIT
- // @description 24/02/2025, 21:06:45 Hacky solution to embed full kick site instead of the embed. I can't promise it will continue to work indefinitely. If it bugs out when resizing the window, try refreshing the page.
- // ==/UserScript==
- function htmlToNode(html) {
- const template = document.createElement('template');
- template.innerHTML = html;
- const nNodes = template.content.childNodes.length;
- return template.content.firstChild;
- }
- function hideSurroundings() {
- [...document.querySelectorAll("nav")].forEach(el => el.style = "display: none;");
- const channelChatroom = document.getElementById("channel-chatroom");
- if (channelChatroom) channelChatroom.style = "display: none";
- const sidebarWrapper = document.getElementById("sidebar-wrapper");
- if (sidebarWrapper) sidebarWrapper.style = "display: none";
- const channelContent = document.getElementById("channel-content");
- if (channelContent) channelContent.style = "display: none";
- const injectedChannelPlayer = document.getElementById("injected-channel-player");
- if (injectedChannelPlayer) {
- injectedChannelPlayer.style = "padding: 0px; max-height: max-content;";
- injectedChannelPlayer.parentNode.style = "max-height: max-content;";
- }
- document.body.firstChild.style = "height: min-content;";
- document.body.style = "height: min-content;";
- [...document.body.firstChild.children].forEach(el => el.style = el.getAttribute("style") ?? "" + ";padding-top: 0px;");
- }
- if (window.location.hostname === "kick.com" && window.self !== window.top) { // Kick inside of iframe
- hideSurroundings();
- setInterval(() => {
- if (![...document.querySelectorAll("nav")].find(el => el.getAttribute("style") && el.getAttribute("style").indexOf("display: none") > -1)) hideSurroundings();
- }, 200);
- } else {
- const { origin, hash } = window.location;
- // Check if the URL starts with the desired base
- const isValidStart = hash.startsWith("#kick/") && window.location.pathname === "/bigscreen";
- // Extract the channel name
- const channel = isValidStart ? hash.split("/")[1] : null;
- if (channel && isValidStart) { // We are watching a kick embed on Destiny.gg
- document.body.appendChild(htmlToNode(`<script type="module" src="https://unpkg.com/x-frame-bypass"></script>`));
- const targetUrl = `https://kick.com/${channel}`;
- id = setInterval(() => {
- const embedContainer = document.getElementById("embed");
- const existingIframe = embedContainer.querySelector(".embed-frame");
- if (!existingIframe) return;
- existingIframe.remove();
- clearInterval(id);
- const iframe = htmlToNode(`<iframe is="x-frame-bypass" class="embed-frame" src="${targetUrl}" allow="fullscreen; autoplay; encrypted-media; picture-in-picture; web-share"></iframe>`);
- embedContainer.appendChild(iframe);
- }, 100);
- }
- }