An HTML5 game engine designed specifically for making visual novels.
This content is released under the MIT License.
Console for mobile browsers
Home Page: https://eruda.liriliri.io
License: MIT License
An HTML5 game engine designed specifically for making visual novels.
This content is released under the MIT License.
this._scriptObserver.observe(document.body, { childList: true });
如果有人在head标签中直接初始化eruda,那么这段代码会报错,因为此时body还没有
禁用 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,所以显然这个判断是有出入的。
code中的es6可以正常执行,但是console窗口中的es6的代码无法正常执行。
:root {
--test: 10px;
}
or
html {
--test: 10px;
}
Uncaught TypeError: Cannot read property 'replace' of undefined
at processStyleRule (eruda.js:12130)
现在移动端,为了适配大小问题,使用rem的解决方案。 具体见 https://github.com/amfe/lib-flexible
三倍屏下,会先把页面的 scale 设成 1/3, 这种情况下,调试面板就太小了。
我们自己写css时,会通过postcss 把px 转成rem。
这个虽然不是库需要考虑的,但是移动端rem还是挺常用,这种情况的确太影响使用了。
用npm install eruda 下载的是1.1.3版本 ,看你demo里用的是 eruda v1.2.0版本
在vue-cli脚手架创建的项目模板中使用eruda代码如下:
在webpack入口文件引入eruda
import eruda from 'eruda';
eruda.init();
eruda看起来挺漂亮的,页面看起来也一切正常,但是当我操作页面的时候(点击、前进或者后退导航),发现操作相应延迟很大,大概2s,会不会是在操作过程中eruda有计算或者执行了什么导致阻塞?或者怎么解决呢?
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.'
请问该怎么解决这类问题?
最近在用一个国产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();
};
})();
不知道什么情况下突然就跳转到支付包的广告页面了
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?
<!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>
前提:
我是通过jquery.getScript()引入的工具。
问题:
多个页面,加载工具的代码一致,但是有时候加载的面板数量不一致。
有时 全都加载进来了
有时只有 Source,Info,Snippets,Features,Settings
jsonp的请求在网络里面看不到,怎么设置呢
cause that i manage my public libs' packages by bower, could u make a register on bower.io?
https
localhost server cant retrieve source
版本: 1.4.3
情景:
把eruda放到我们私有cdn上的时候,会出现 stringifyWork.js
404
建议把它打到包里面。或者开发一个dev
包
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?
this make a bit difficult to use it
比如:
eruda.hide();
eruda.show();
这真是一个很棒的工具~~
使用的是小米5测试的。
首先是一些样式问题:
1.html根节点的font-size会影响elements版块的“节点”字体大小,不方便浏览,建议隔离页面的样式影响,同样受影响的有snippets、sources版块;
2.resource版块的属性跟值同一行展示,当属性名称很长时,值会被挤成竖向显示,导致左边出现大块空白;
其它反馈:
当访问的是纯静态的html文件时,微信里使用snippets的刷新页面功能基本没用,囧~~(是不是可以通过ajax获取内容来刷新页面。。。)
最后,感谢提供这么一个好工具~
当我无刷新改变地址栏的地址的时候,info面板中的Location块显示的信息并没有及时更新。比如location.hash = ''的方式
Uncaught TypeError: Cannot read property 'navigationStart' of undefined
你好请教个问题,在点击network的时候报错,其他可以用
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) { ... })
.
Error: 'Draggabilly' is not exported by node_modules\[email protected]@draggabilly\draggabilly.js
我这样写就报上面的错?我用的rollup
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)
在手机端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)
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.
使用 ionic 开发 Hybrid App,调试(ionic serve)及模拟(cordova emulate ios)时正常,编译(cordova build iso)成ios app不显示eruda图标
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.
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
请问在 angular + typescript 下如何使用?
I find a thing that console panel can not output cookie when cookie is very long.Is it a bug?
如题,一定要用npm吗?
没办法直接引用js文件吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.