您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fixes quoting in the Javascript by escaping the single quotes in the function calls.
// ==UserScript== // @name [WorldWideTorrents.eu] Fix JS Quoting // @namespace pxgamer // @version 0.2.0 // @description Fixes quoting in the Javascript by escaping the single quotes in the function calls. // @author pxgamer // @include http*://*worldwidetorrents.eu* // @require https://code.jquery.com/jquery-3.1.0.min.js // @grant none // ==/UserScript== /*jshint multistr: true */ (function() { 'use strict'; function escapeHtml (text) { return text .replace(/&/g, "&") .replace(/</g, "<") .replace(/>/g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } const reg = /(javascript:SmileIT\(\'\[quote\=)([\s\S]+?)(\[\/quote\]\',[\s\S]+?\'Form\',[\s\S]+?\'body\'\);)/i; $('a[href^="javascript:SmileIT("]').each(function(){ let url = $(this).attr('href'); let match = reg.exec(url); console.log(match); if (match !== null) { let match1 = match[2]; let match2 = match[2].replace(/\'/g, "\\'"); $(this).attr('href', url.replace(match1, match2)); } }); })();