您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Небольшой QoL скрипт для ДеградачВики
// ==UserScript== // @name DegradachWiki QoL // @namespace http://tampermonkey.net/ // @version 1.2 // @description Небольшой QoL скрипт для ДеградачВики // @author Inoix // @match https://www.youtube.com/watch* // @match https://vk.com/video* // @icon https://static.miraheze.org/degrabebswiki/a/a4/Faviconchik.png // @grant none // ==/UserScript== function fallbackCopyTextToClipboard(text) { var textArea = document.createElement("textarea"); textArea.value = text; // Avoid scrolling to bottom textArea.style.top = "0"; textArea.style.left = "0"; textArea.style.position = "fixed"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'successful' : 'unsuccessful'; console.log('Fallback: Copying text command was ' + msg); } catch (err) { console.error('Fallback: Oops, unable to copy', err); } document.body.removeChild(textArea); } function getTime(timeclass) { var timeElement = document.getElementsByClassName(timeclass); var text = timeElement[0].textContent; var timeraw = text.split(":"); timeraw.reverse(); var timereal = 0; var cur = 1; for (var time of timeraw) { timereal = timereal + Number(time)*cur; cur = cur * 60; }; return [timereal, timeraw] } function processVK() { var timeclass = "_time_current"; const timereal = getTime(timeclass)[1]; console.log(timereal); //console.log(timereal.length); var current_url = window.location.href; var slice_id = current_url.indexOf("?t="); if (slice_id !== -1) { current_url = current_url.slice(0,slice_id); }; const timeDict = ["s","m","h"]; let i,texttime; for (i = timereal.length-1, texttime = ""; i > -1; i--) { var T = timereal[i]; texttime = texttime +T+timeDict[i]; //console.log(texttime+" "+T+" "+timeDict[i]); } var new_url = current_url + "?t=" + texttime return new_url } function processYT() { var timeclass = "ytp-time-current"; var timereal = getTime(timeclass)[0]; console.log(timereal); var current_url = window.location.href; var slice_id = current_url.indexOf("&t="); if (slice_id !== -1) { current_url = current_url.slice(0,slice_id); }; var new_url = current_url + "&t=" + timereal + "s" return new_url } function copyTextToClipboard(text) { if (!navigator.clipboard) { fallbackCopyTextToClipboard(text); return; } navigator.clipboard.writeText(text).then(function() { console.log('Async: Copying to clipboard was successful!'); }, function(err) { console.error('Async: Could not copy text: ', err); }); } (function() { 'use strict'; document.onkeypress = function (e) { var exceptKey = "Backquote"; e = e || window.event; if (e.code != exceptKey) {return}; var current_url = window.location.href; var new_url; if (current_url.includes("youtube.com")) { new_url = processYT(); } else { new_url = processVK(); } copyTextToClipboard(new_url); }; // Your code here... })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址