Firefox 移动错误控制台丢失

bit*_*arr 5 javascript browser debugging mobile android

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

Firefox 移动版本 14 (2012-06-26)中是否有错误控制台?

Pau*_*tte 1

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

以下是查找错误控制台图标的方法:

错误控制台似乎已被弃用,因此书签是其余移动调试替代方案中最简单的:

  • 安卓控制台:
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("错误:%20\""+msg+"\"%20at%20\""+"\",% 20line%20"+line);}window.addEventListener("touchstart",function(e){if(e.touches.length===3){console.show();}});}})() ;
  • 萤火虫精简版:
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]('头')[0]||F[e]('身体')[0])。 appendChild(E);E=new%20Image;E[r]('src',I+L);})(文档,'createElement','setAttribute','getElementsByTagName','FirebugLite','4', 'firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');