显示JS SDK调试信息

try to take over the world!

目前為 2016-06-06 提交的版本,檢視 最新版本

// ==UserScript==
// @name         显示JS SDK调试信息
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  try to take over the world!
// @author       You
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    console.log("start printing messages");
    var jsonstringify = JSON.stringify;
    window._vds_data = [];
    JSON.stringify = function(value, replacer, space) {
        if (value.length > 0 && value[0].d == location.hostname) {
            if (value[0].t != 'imp') {
                console.warn(jsonstringify(value, 0, 2));
            } else {
                console.log(jsonstringify(value, 0, 2));
            }
            _vds_data.push(value);
        }
        return jsonstringify(value, replacer, space);
    };
})();