您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Spam those douchebags
当前为
- // ==UserScript==
- // @name Fxp Message scribble
- // @namespace http://tampermonkey.net/
- // @version 1.2
- // @description Spam those douchebags
- // @author MrTarnegol
- // @match https://www.fxp.co.il/*
- // @grant none
- // ==/UserScript==
- 'use strict';
- const MIN_SIZE = 3;
- const MAX_SIZE = 5;
- window.MIN_SIZE = MIN_SIZE;
- window.MAX_SIZE = MAX_SIZE;
- const getText = () => {
- const selector = '.cke_editor iframe'
- const element = $(selector)[0];
- if (element !== undefined) {
- const doc = element.contentWindow.document;
- return doc.getElementsByClassName("forum")[0].innerText;
- }
- return '';
- }
- window.getText = getText;
- const setText = (text) => {
- const selector = '.cke_editor iframe'
- const element = $(selector)[0];
- if (element !== undefined) {
- var doc = element.contentWindow.document;
- doc.getElementsByClassName("forum")[0].innerText = text;
- return true;
- }
- return false;
- }
- window.setText = setText;
- const randomSize = () => {
- const SIZES = MAX_SIZE - MIN_SIZE + 1;
- return Math.floor(Math.random() * SIZES) + MIN_SIZE;
- }
- window.randomSize = randomSize;
- const letterWithSize = (letter, size = randomSize()) => {
- return letter != ' ' ? `[SIZE=${size}]${letter}[/SIZE]` : ' ';
- }
- window.letterWithSize = letterWithSize;
- const scribbleText = (text) => {
- let isText = true;
- return text.split('').reduce((a, b) => {
- if (b == ']') { isText = true; return a + b; };
- if (b == '[') { isText = false; return a + b; };
- return isText ? a + letterWithSize(b) : a + b;
- }, '');
- }
- window.scribbleText = scribbleText;
- const scribble = () => {
- console.log('MrTarnegol scribbling begin!');
- const text = getText();
- const scribbled = scribbleText(text);
- setText(scribbled);
- CKEDITOR.tools.callFunction(5, this);
- }
- window.scribble = scribble;
- const scribbleButton = () => {
- const button = document.createElement('button');
- button.style.position = 'fixed';
- button.style.bottom = '0'; //'200px';
- button.style.left = 0;
- button.style.backgroundColor = '#73AD21';
- button.style.padding = '15px 40px';
- button.style.fontSize = '18px';
- button.innerText = 'ערבל טקסט';
- button.onclick = scribble;
- return button;
- }
- const start = () => {
- if (window.top == window.self) {
- const btn = scribbleButton();
- document.body.appendChild(btn);
- }
- }
- start();