抖音测试插件
// ==UserScript==
// @name 抖音测试插件
// @namespace http://tampermonkey.net/
// @version 2024-12-05
// @description try to take over the world!
// @author You
// @match http://*.douyin.com/*
// @match https://*.douyin.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant GM_addStyle // 必须声明使用GM_addStyle
// @grant none
// ==/UserScript==
(function() {
console.log("开始执行自定义脚本.....................");
function clickDiv(divname){
document.getElementsByClassName('kT7icnwc')[0].click();
}
function getMsgs(){
var divComment = document.getElementsByClassName("comment-mainContent");
const divs = divComment[0].getElementsByClassName('xzjbH9pV');
console.log("获取到"+divs.length+"条评论");
for(var i=0;i元素并添加到
var domStyle = document.createElement('style');
domStyle.type = 'text/css';
domStyle.appendChild(document.createTextNode(`
#mytoast {
position: fixed;
top: 120px;
left: 20px;
min-width: 200px;
padding: 10px;
background-color: #333;
color: #fff;
border-radius: 5px;
z-index: 10000;
display: none;
opacity: 0.9;
}
#buttonscontainer {
position: fixed;
top: 10px;
left: 10px; /* 设置按钮容器在左上角 */
z-index: 10000;
}
.toastbutton {
margin: 5px;
padding: 10px 15px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.toastbutton:hover {
background-color: #0056b3;
}
`));
document.head.appendChild(domStyle);
// 创建按钮容器
const container = document.createElement('div');
container.id = 'buttonscontainer';
// 创建按钮
const buttons = ['获取搜索结果', '点击评论', '滚动到底部', '获取评论列表'];
buttons.forEach((text) => {
const button = document.createElement('button');
button.innerText = text;
button.className = 'toastbutton';
button.onclick = () => {
if(text == "点击评论"){
clickDiv("kT7icnwc");
setTimeout(()=>{
document.getElementById('semiTabcomment').click();
},1000);
}
if(text == "滚动到底部"){
scrollBottom();
}
if(text == "获取评论列表"){
getMsgs();
}
showToast(`你点击了${text}`);}
container.appendChild(button);
});
document.body.appendChild(container);
// 创建Toast元素
const toast = document.createElement('div');
toast.id = 'mytoast';
document.body.appendChild(toast);
// 显示Toast提示
function showToast(message) {
toast.innerText = message;
toast.style.display = 'block';
toast.style.opacity = '1';
// 隐藏Toast
setTimeout(() => {
toast.style.opacity = '0';
setTimeout(() => {
toast.style.display = 'none';
}, 500); // 等待动画结束
}, 2000); // 2秒后自动关闭
}
function initBtn() {
let topDiff = 0,
leftDiff = 0;
$btn.style.position = "fixed";
$btn.style.width = "44px";
$btn.style.height = "22px";
$btn.style.lineHeight = "22px";
$btn.style.top = "14%";
$btn.style.right = "30%";
$btn.style.background = "#0084ff";
$btn.style.fontSize = "14px";
$btn.style.color = "#fff";
$btn.style.textAlign = "center";
$btn.style.borderRadius = "6px";
$btn.style.zIndex = 10000;
$btn.style.cursor = "pointer";
$btn.style.opacity = 0.1;
$btn.innerHTML = "copy";
$btn.addEventListener("click", function () {
// 在这里执行你想要的复制操作
});
}
let $btn = document.createElement("div");
initBtn();
document.body.prepend($btn);
})();
逗比拯救世界 破解表情保存功能
// ==UserScript==
// @name 逗比拯救世界 破解表情保存功能
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include http*://www.dbbqb.com/paint/*
// @match https://greasyfork.org/zh-CN/users/226081-yujinpan
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
function getCanvas2(){
var cans = document.getElementsByTagName("canvas");
for(var i=0;i