Giter Site home page Giter Site logo

liriliri / eruda Goto Github PK

View Code? Open in Web Editor NEW
17.3K 334.0 1.1K 3.44 MB

Console for mobile browsers

Home Page: https://eruda.liriliri.io

License: MIT License

JavaScript 83.97% CSS 2.26% HTML 3.89% SCSS 9.88%
console mobile debugger developer-tools eruda

eruda's Introduction

liriliri

An HTML5 game engine designed specifically for making visual novels.

License

This content is released under the MIT License.

eruda's People

Contributors

fa-ge avatar gitter-badger avatar greenmashimaro avatar jungzl avatar keqingrong avatar mathiasbynens avatar mayness avatar modderme123 avatar moklick avatar omarchehab98 avatar sekedus avatar surunzi avatar tlongzou avatar unclebill avatar zilong-thu avatar zjffun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eruda's Issues

关于console窗口

code中的es6可以正常执行,但是console窗口中的es6的代码无法正常执行。

在手机端QQ浏览器下不显示Console菜单

在手机端QQ浏览器下不显示Console菜单。
添加如下代码:
try {eruda.init({tool: 'console'});} catch(e) {alert(e.stack)};
后可以看到错误堆栈:
TypeError:Cannot call method 'bind' of undefined at http://192.168.1.211:8080/myApp/js/eruda.js:7619:68 at Array.forEach(native) at Console.overrideConsole(http://192.168.1.211:8080/myApp/js/eruda.js:7618:29) at Console._initConfig(http://192.168.1.211:8080/myApp/js/eruda.js:7784:51) at console.init(http://192.168.1.211:8080/myApp/js/eruda.js:7602:19) at Devtools.add(http://192.168.1.211:8080/myApp/js/eruda.js:7135:31) at http://192.168.1.211:8080/myApp/js/eruda.js:197:33 at Array.forEach(native) at Object.initTools(http://192.168.1.211:8080/myApp/js/eruda.js:194:15) at Object.init(http://192.168.1.211:8080/myApp/js/eruda.js:133:15)

Eruda requires lax Content Security Policy (CSP)

Thank you for this nice tool!

I'm using a Content Security Policy (CSP) as defense in depth against Cross-site scripting (XSS) security vulnerabilities. Eruda currently requires the following CSP:

Content-Security-Policy: script-src https://liriliri.github.io/eruda/eruda.min.js 'unsafe-inline'; font-src data:

I'd like to get rid of the unsafe-inline directive. Eruda seems to be working fine without this directive but the Chrome Developer Tools Console logs errors:

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src https://liriliri.github.io/eruda/eruda.min.js". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

This seems to be triggered by "ontouchstart" attributes which exists on multiple elements injected by Eruda (example). These attributes don't have a value. What is their purpose? Can they be removed?

禁用 displayGetterVal 选项后仍无法过滤父 prototype 上的 getter

禁用 displayGetterVal 后,eruda 使用 _getOwnPropertyDescriptor2 来获取 get,并且在获取到 get 时不进行属性访问。

不过 _getOwnPropertyDescriptor2 获取不到父 prototype 上的 get,所以仍然有可能出现和 #14 同样的问题。
建议使用类似这样的代码来获得 prototype chain 上的 descriptor

function _getPropertyDescriptor (obj, name) {
    while (obj) {
        var pd = Object.getOwnPropertyDescriptor(obj, name);
        if (pd) {
            return pd;
        }
        obj = Object.getPrototypeOf(obj);
    }
    return null;
}

更新:

if (!getterVal) {
  var descriptor = (0, _getOwnPropertyDescriptor2.default)(obj, name);
  if (descriptor.get) {
    return parts.push(key + ': ' + wrapStr('(...)'));
  }
}
parts.push(key + ': ' + stringify(topObj[name], passOpts));

这里 _getOwnPropertyDescriptor2 时,获取的是 obj,而最后访问属性时用的是 topObj,就导致了 descriptor.get 拿不到正确的对象。
在我们项目中,getter 是设置在 cc.Node 的 prototype 上面,但这里判断用的 obj 是 cc.Node 的父类的 prototype,所以显然这个判断是有出入的。

监控jsonp请求的代码有点问题

this._scriptObserver.observe(document.body, { childList: true });
如果有人在head标签中直接初始化eruda,那么这段代码会报错,因为此时body还没有

Cannot use 'in' operator to search for 'revokeObjectURL'

eruda.min.js:2 Uncaught TypeError: Cannot use 'in' operator to search for 'revokeObjectURL' in /M/Public
at Object. (eruda.min.js:2)
at t (eruda.min.js:2)
at Object. (eruda.min.js:2)
at t (eruda.min.js:2)
at Object. (eruda.min.js:2)
at t (eruda.min.js:2)
at eruda.min.js:2
at eruda.min.js:2
at eruda.min.js:2
at eruda.min.js:2

aHR0cDovL2Zycy5nbWRlbmcuc2ltaWFvLmNuL2luZGV4LnBocC9MYW1wL2luZGV4Lmh0bWw%3D.html:74 Uncaught ReferenceError: eruda is not defined
at HTMLScriptElement.script.onload (aHR0cDovL2Zycy5nbWRlbmcuc2ltaWFvLmNuL2luZGV4LnBocC9MYW1wL2luZGV4Lmh0bWw%3D.html:74)

显示不正常

环境React单页应用。
使用:

import * as eruda from 'eruda';
eruda.init();

结果:
wechatimg41

Toggle switches in Settings are very difficult to use

I noticed that the toggle switches in the Settings tab don't respond very well to either taps (or clicks in desktop browser). I have tap on them several times in order to get it to change state. All other UI interactions work just fine... just these toggle switches are not very responsive. My app has code to optimize touch/click events, so I suspect this might be interfering with these toggles. Any chance the toggles could just be changed to ordinary checkboxes?

默认初始化,但是加载面板的数量有问题

前提:
我是通过jquery.getScript()引入的工具。

问题:

多个页面,加载工具的代码一致,但是有时候加载的面板数量不一致。

有时 全都加载进来了
有时只有 Source,Info,Snippets,Features,Settings

动态插入的script报错

最近在用一个国产hybrid框架的时候发现,用静态的script标签没问题,但是用动态插入的script,用该框架的模拟器点击右下角的eruda会报错:Cannot set property type of #<Event> which has only a getter,chrome上的报错为:Cannot assign to read only property 'type' of object '#<Event>'。

(function() {
    var consoleScript = document.createElement("script");
    consoleScript.src = "js/eruda.min.js";
    document.head.appendChild(consoleScript);
    consoleScript.onload = function() {
        eruda.init();
    };
})();

微信浏览器默认初始化面板数量有问题

  try {
    require('eruda').init()
  } catch (e) {
    alert(e)
  }

alert 出来信息是 TypeError: str.slice is not a function. (In 'str.slice(0, len'), 'str.slice' is undefined)

系统:iOS 9.3.5
微信:6.5.5(UIwebview)

qq20170303-182546 2x

qq20170303-183410 2x

qq20170303-183451 2x

can not show cookie

I find a thing that console panel can not output cookie when cookie is very long.Is it a bug?

vuejs使用eruda延迟问题

在vue-cli脚手架创建的项目模板中使用eruda代码如下:
在webpack入口文件引入eruda

import eruda from 'eruda';
eruda.init();

eruda看起来挺漂亮的,页面看起来也一切正常,但是当我操作页面的时候(点击、前进或者后退导航),发现操作相应延迟很大,大概2s,会不会是在操作过程中eruda有计算或者执行了什么导致阻塞?或者怎么解决呢?

Entry Button Responsiveness

Entry Button Responsiveness Screencast

When resizing the browser, the entry button should recalculate its position in case it goes out of the viewport bounds.

stringifyWork.js 404

版本: 1.4.3

情景:
把eruda放到我们私有cdn上的时候,会出现 stringifyWork.js 404

建议把它打到包里面。或者开发一个dev

无法捕获promise中的错误

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta content="telephone=no" name="format-detection" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="default" name="apple-mobile-web-app-status-bar-style">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title></title>
</head>
<body>
    <script src="//cdn.jsdelivr.net/eruda/1.2.2/eruda.min.js"></script>
    <script>eruda.init();</script> 
    <script>
        new Promise(function(resolve, reject){
            resolve();
        }).then(function(res){
            var a = res.a;
        })
    </script>
</body>
</html>

浏览器可以捕捉到错误:

(index):18 Uncaught (in promise) TypeError: Cannot read property 'a' of undefined
    at (index):18
    at <anonymous>

Not running

https
localhost server cant retrieve source

Error: Refused to get unsafe header "Content-Length"

What a great tool this is! For the most part, it works flawlessly. However, I'm getting a lot of errors from eruda Refused to get unsafe header "Content Length". My code uses Angular and makes frequent XHR requests. My guess is that eruda is having trouble inspecting the headers returned by the XHR requests. Thanks for looking into this.

Use Eruda on a page not mine?

Hello, thanks for a much needed tool. How can I use Eruda on a page which is not mine (so that I cannot write a script inside)? TIA

与 lazysizes 一起使用时出现了个问题

screenshot from 2017-08-17 11-31-17
screenshot from 2017-08-17 11-30-49

参考上面两个图
lazysizes 中执行 addEventListener('resize', debouncedUpdateElementsSizes); 时
在 eruda 中的 overrideEventTarget 里 this 即 addEvent 的 target / el 为 undefined
导致 lazysizes 无法正常执行

我没有整明白这里面到底是怎么引起的, 是否有需要将 addEvent 的 el 参数默认为 window ???

打印具备 deprecated 方法的对象时会报错

API 升级后,经常会保留一些旧版本的 API 接口作为过渡,例如

Object.defineProperty(Sprite.prototype, 'cascade', {
  get: function () {
    console.error('Sprite.cascade is deprecated, use Node.cascade please.');
    return this._realCascade;
  },
  enumerable: false
})

然后如果用户尝试输出 console.log(sprite),就会看到多了上面的报错:'Sprite.cascade is deprecated, use Node.cascade please.'

请问该怎么解决这类问题?

Monitoring Fetch Requests

window.fetch is currently not being monitored by Eruda.

Unlike XHR requests, fetch can be monitored through an event listener, window.addEventListener('fetch', function (request) { ... }).

在微信浏览器中的一些问题

这真是一个很棒的工具~~

使用的是小米5测试的。

首先是一些样式问题:
1.html根节点的font-size会影响elements版块的“节点”字体大小,不方便浏览,建议隔离页面的样式影响,同样受影响的有snippets、sources版块;
2.resource版块的属性跟值同一行展示,当属性名称很长时,值会被挤成竖向显示,导致左边出现大块空白;

其它反馈:
当访问的是纯静态的html文件时,微信里使用snippets的刷新页面功能基本没用,囧~~(是不是可以通过ajax获取内容来刷新页面。。。)

最后,感谢提供这么一个好工具~

bad classes in eruda.

Please, if possible, delete classes that do not begin with "eruda-". I met a problem with the class "filter". My code uses this class to define a component in DOM. I'm getting errors in the console. Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.