javascript 可以在三星平板电脑的本机浏览器上调试javascript吗
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17443691/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can one debug javascript on a samsung tablet's native browser
提问by Yannick
I am currently working on a HTML/JS application that will be embedded in an iOS and an Android app. Because the android app is not yet finished I am testing this on the chrome browser in Android. I fixed all issues there but when I open the same web app in the native browser nothing really works as expected.
我目前正在开发一个 HTML/JS 应用程序,该应用程序将嵌入到 iOS 和 Android 应用程序中。因为安卓应用程序还没有完成,我正在安卓的chrome浏览器上测试这个。我在那里解决了所有问题,但是当我在本机浏览器中打开相同的 Web 应用程序时,没有任何真正按预期工作。
So my question is : Is there a way to debug in a native browser on an android device?
所以我的问题是:有没有办法在 android 设备上的本机浏览器中进行调试?
In chrome this was pretty easy with remote debugging.
在 chrome 中,远程调试很容易做到这一点。
(Please do not advice me to use 'log' statements for debugging because that's not what I am looking for here)
(请不要建议我使用“日志”语句进行调试,因为这不是我在这里寻找的内容)
And just to spill my guts : the Samsung Tablet's native browser is the only device that's causing me a headache!
顺便说一句:三星平板电脑的原生浏览器是唯一让我头疼的设备!
回答by Nick 'BadAttitude' Gibson
Typing about:debug
in the address bar of the native browser will togglethe 'Debug' options in the settings menu.
about:debug
在本机浏览器的地址栏中键入将切换设置菜单中的“调试”选项。
The 'Show JavaScript Console' option will allow you to see JavaScript errors in your webpage.
“显示 JavaScript 控制台”选项将允许您查看网页中的 JavaScript 错误。
NB I believe the JavaScript Console will only be displayed if there is an error.
注意,我相信 JavaScript 控制台只会在出现错误时显示。
HTH
HTH
Nick.
缺口。
回答by Sebastian Barth
The new Samsung Internetbrowser (I think you meant this browser with "Samsung Tablet's native browser") is now based on the Chromium browser and thus supports its remote debugging interface.
新的三星 Internet浏览器(我想你是说这个带有“三星平板原生浏览器”的浏览器)现在基于 Chromium 浏览器,因此支持其远程调试界面。
- Enable USB debugging on your device as described here.
- Then connect your device via USB (Oh, surprise!).
Visit
chrome://inspect
on your computers Google Chrome browser and you will be guided to create the connection:- Then you just have to click on the devices
inspect
link and an developer tools window will pop up.
- 按照此处所述在您的设备上启用 USB 调试。
- 然后通过 USB 连接您的设备(哦,惊喜!)。
chrome://inspect
在您的计算机上访问Google Chrome 浏览器,您将被引导创建连接:- 然后你只需要点击设备
inspect
链接,就会弹出一个开发者工具窗口。
More info like why there is an Samsung InternetBrowser at all can be found here.
更多信息,比如为什么有三星互联网浏览器,可以在这里找到。
回答by Taras Feschuk
回答by sidonaldson
If you have updated your device you can go to settings
-> Debug
-> 'Remote Debug Enable'
Once enabled you can debug the native browser just like you can debug chrome.
如果您更新了您的设备,您可以转到settings
-> Debug
->'Remote Debug Enable'
一旦启用,您就可以像调试 chrome 一样调试本机浏览器。
回答by Nourdine Alouane
You can try vorlonsolution too, it has a nice web interface & very easy to install
您也可以尝试vorlon解决方案,它有一个很好的 Web 界面并且很容易安装
& It's free
& 免费
But if you can't see clear console errors with volron, you probably want to use @Nick's solution, sometimes complex errors prevents even vorlon or weinerfrom catching them. So once you fix blocking these issues, probably volron will start catching them properly
但是,如果你不能看到volron清除控制台的错误,你可能需要使用@尼克的解决方案,有时是复杂的错误阻止甚至vorlon或韦纳从赶上他们。所以一旦你解决了这些问题,可能 volron 会开始正确地捕捉它们