您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
去除JSON字符串Result标签后的双引号包裹
当前为
// ==UserScript== // @name 燕谷坊来店易API去除result后面的双引号 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 去除JSON字符串Result标签后的双引号包裹 // @author djzhao // @match *://*.hulianjun.com/* // @match http://127.0.0.1/* // @grant none // @icon https://avatars1.githubusercontent.com/u/10238070?s=460&v=4 // @run-at document-end // ==/UserScript== (function() {// {"Code":"000","Message":"操作成功!","Result":{"promotionCount":1}} 'use strict'; var tag = document.getElementsByTagName('pre')[0]; var _html = tag.innerText; if (_html.lenght != 0) { // 去除 " _html = _html.replace('"Result":"{','"Result":{'); // 去除 " _html = _html.replace(/}"}$/,'}}'); // \" 转为 " _html = _html.replace(new RegExp('\\\\"',"gm"),'"'); // 保留转移字符 \\ 转为 \ _html = _html.replace(new RegExp('\\\\\\\\',"gm"),'\\'); } tag.innerText = _html; })();