O'Reilly logo

Programming the Mobile Web, 2nd Edition by Maximiliano Firtman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18. Debugging and Performance

Debugging and performance optimization are the two scariest activities in the mobile web development world after testing, but don’t worry. There are lots of ways to tame them. On Chapter 4 we have already discussed tools and techniques for testing. In this chapter we will focus on more advanced features, for debugging and performance.

Debugging

For years I’ve complained that web developers were second-class developers against native developers in terms of tools and documentation. Fortunately starting in 2012, vendors realize that web developers needs more tools for debugging and performance measurement and the tools’ catalog available today is growing.

Server-Side Debugging

To debug server-side detection, adaptation, or content delivery scripts, we can use some HTTP tools before turning to real devices.

User agent spoofing

User agent spoofing tools allow us to cheat the server about the browser that is currently requesting the webpage changing how the client identifies itself to the server. Therefore using a desktop browser we can say it is a mobile browser and the server will fall into the trap. We can use these tools to debug mobile redirects and detection frameworks as we have covered in Chapter 9 without the need of real devices or even emulators.

You can then browse to any website and see how the server manages the user agent and which content it serves. Remember to go back to the default user agent after finishing the debug session, or you may ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required