您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
生成评论区伪装链接
当前为
// ==UserScript== // @name Bilibili 黄嘉琪小助手 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 生成评论区伪装链接 // @author as042971 // @include *://www.bilibili.com/video/av* // @include *://www.bilibili.com/video/BV* // @license MIT // @grant none // @esversion 8 // ==/UserScript== (function() { 'use strict'; const inject = function(box) { let fakeDiv = document.createElement('div'); fakeDiv.setAttribute('class','share-link'); let fakeInput = document.createElement('input'); fakeInput.setAttribute('type','text'); fakeInput.setAttribute('placeholder', '在这里粘贴封面视频地址…'); let fakeBtn = document.createElement('span'); fakeBtn.setAttribute('class','btn'); fakeBtn.innerHTML = '生成诈骗链接'; fakeBtn.onclick = () => { const input = fakeInput.value; const reg = /BV[A-Za-z0-9]{10}/; const result = reg.exec(input); if (result) { const bvID = result[0]; const avID = window.aid; const link = 'https://b23.tv/av' + avID + '?' + bvID; // 复制到剪贴板 let aux = document.createElement("input"); aux.setAttribute("value", link); document.body.appendChild(aux); aux.select(); document.execCommand("copy"); document.body.removeChild(aux); } } fakeDiv.appendChild(fakeInput); fakeDiv.appendChild(fakeBtn); box.appendChild(fakeDiv); }; let body = document.body; let observerOptions = { childList: true, attributes: false, subtree: false }; let observer = new MutationObserver((mutation_records) => { let box = document.querySelector('.box-left'); if (box) { inject(box); observer.disconnect(); } }); observer.observe(body, observerOptions); })();