Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开启时,浏览器原生console只支持一个参数 (Google Chrome下调试不便) #9

Open
mc-zone opened this issue Jul 27, 2015 · 1 comment

Comments

@mc-zone
Copy link

mc-zone commented Jul 27, 2015

Scripts/Rosin/InjectionScript.js#L147

插件开启时,对原有console的继续执行,为何只支持一个参数呢? oldFun(arguments[0]);
这会导致浏览器调试时,原来 console.log(123,456); 最后浏览器只输出 123

if (Object.prototype.hasOwnProperty.call(source, prop)) {
    // 不覆盖原方法执行,只是加个壳
    (function(obj, prop) {
        if (typeof obj[prop] === "function") {
            var oldFun = obj[prop].bind(obj);
            obj[prop] = function() {
                source[prop].apply(source, arguments);
                // oldFun.apply(obj, arguments);
                oldFun(arguments[0]);
            };
        } else {
            obj[prop] = source[prop];
        }
    })(obj, prop);
}
@websiteflash
Copy link
Contributor

确实存在这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants