safari 调试移动端
I was developing a mobile web application for work that scans a QR code to check someone in for a hiring event, and I wanted to make sure the data being decoded from the QR code was correct. I also wanted to make sure one of my key function’s conditional statements was being evaluated properly. I was able to do this easily on my laptop with the help of Google Chrome’s Console.
我正在开发一个用于工作的移动Web应用程序,该应用程序扫描QR码以检查某人是否有招聘事件,并且我想确保从QR码解码的数据是正确的。 我还想确保正确评估了我的关键函数的条件语句之一。 借助Google Chrome浏览器的控制台,我可以轻松地在笔记本电脑上执行此操作。
For those unfamiliar with Google Chrome’s Console, it’s an extremely helpful development tool where all you have to do is put debuggers, console logs, etc. in the parts of your code you want to debug.
对于那些不熟悉Google Chrome浏览器控制台的人来说,它是一个非常有用的开发工具,您要做的就是将调试器,控制台日志等放在要调试的代码部分中。
You run the program while the Console is open, and once the program hits the line of code that has the debugger, it pauses the program so you can test for variables and other important values within the scope of your function. For more information about Google Chrome’s Console, check out this link.
您可以在控制台打开的情况下运行该程序,并且一旦程序进入了带有调试器的代码行,它就会暂停该程序,以便您可以在函数范围内测试变量和其他重要值。 有关Google Chrome浏览器控制台的更多信息,请查看此链接 。
Unfortunately, Google Chrome doesn’t yet have mobile-console functionality.
不幸的是,谷歌浏览器还没有移动控制台功能。
After a little bit of research, I was able to find a pretty useful solution in Safari, a web browser I haven’t used in years. It can achieve virtually the same thing that Google Chrome Console can, with no downloads or any extraneous work — aside from changing some settings on your iPhone and Mac. Here’s how you