您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Just random links. If link is valid - left's it here
// ==UserScript== // @name File Karelia randomizer // @description Just random links. If link is valid - left's it here // @match http://file.karelia.ru/* // @grant GM_addStyle // @grant GM_openInTab // @version 1 // @license MIT // @namespace https://greasyfork.org/users/205894 // ==/UserScript== //Create a button in a container div var zNode = document.createElement ('div'); zNode.innerHTML = '<button id="myButton" type="button">' + 'For Pete\'s sake, don\'t click me!</button>' ; zNode.setAttribute ('id', 'myContainer'); document.body.appendChild (zNode); //--- Activate the newly added button. document.getElementById ("myButton").addEventListener ( "click", ButtonClickAction, false ); Reload(); function Reload(){ var element = document.getElementById('mainContent'); if (typeof(element) != 'undefined' && element != null) { document.getElementById("myButton").click(); } else { document.getElementById("myButton").click(); } } function ButtonClickAction (zEvent) { //There is Actions for click const newSshotUrl = `http://file.karelia.ru/${makeid()}`; var element = document.getElementById('mainContent'); if (typeof(element) != 'undefined' && element != null) { GM_openInTab(newSshotUrl); } else { console.error(newSshotUrl); console.error(makeid()); GM_openInTab(newSshotUrl); window.close() } document.getElementById ("myContainer").appendChild (zNode); } function reloadPage() { window.location.reload(); } function makeid() { let length = 6; let result = ''; const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; const charactersLength = characters.length; let counter = 0; while (counter < length) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); counter += 1; } return result; }