javascript - 缺少 Firefox 移动错误控制台

标签 javascript android debugging mobile browser

我正在开发一个移动网站,它在 Android stock 浏览器中运行良好。在 Firefox 中,某些 JavaScript 函数不起作用。所以我在谷歌上搜索错误控制台。我找到了一个支持页面,其中提供了有关早期版本错误控制台的信息。

Firefox for mobile version 14中是否有错误控制台(2012-06-26)?

最佳答案

看起来它是隐藏的,但是添加了browser.console.showInPaneldevtools.errorconsole.enabled然后在 about:config 中将两者都设置为“true”将为 JavaScript 调试目的启用控制台和首选项面板。

这里是如何找到错误控制台图标:

错误控制台似乎已被弃用,因此小书签是 remaining mobile debugging alternatives 中最简单的一个:

  • Android 控制台:
javascript:(function(){if((/android/gi).test(navigator.appVersion)){console={"_log":[],"log":function(){var%20arr=[];for(var%20i=0;i%20\""+value+"\"");}},"show":function(){alert(this._log.join("\n"));this._log=[];}};window.onerror=function(msg,url,line){console.log("ERROR:%20\""+msg+"\"%20at%20\""+"\",%20line%20"+line);}window.addEventListener("touchstart",function(e){if(e.touches.length===3){console.show();}});}})();
  • Firebug 精简版:
javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');

关于javascript - 缺少 Firefox 移动错误控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11688340/

相关文章:

android - 如何可视化指向特定坐标(纬度,经度)的箭头,给定俯仰和偏航

c++ - 在 dbx 中单步执行时的 tb_event_death

javascript - Geoserver 2.10 Openlayers 3 TextSymbolizer 标签未显示

java - 使用警报管理器进行每日通知

android - 如何在android中使用ffmpeg合并多个mp3文件

python - 在调试期间检查常量或变量张量的值

c - Valgrind 错误 : invalid write of size 4 (but says error is in free() )

Javascript删除带有元素删除的点击事件

javascript - Bcryptjs 异步不工作

javascript - 为什么 'confirm password and password' 同一部分不工作?