Cover by Maximiliano Firtman

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required