Watches, Network overrides and more

We have two more features for you as we move ever closer to Opera Dragonfly 1.0 release.

Watch expressions

The first is the Watches feature in the JavaScript Debugger. A watch can monitor a user defined variable or expression while the web page runs. The expression will be evaluated and the result will be shown. As you step through the code it will show the result at that moment in time. A watch expression can be as simple as a variable name, or as complex as any valid JavaScript expressions.

To test this feature out, load this Watches test file in Opera. Switch to the state tab of the JavaScript debugger and add the following expressions to the Watches panel:

  • a
  • b
  • c
  • d
  • a.a + b.b
  • c / d

Enter each expression you wish to add, and click the add button to submit that watch. After you've added the watch expressions, click the test button in the web page. This will run the JS code until the debugger statement is reached. You’ll notice that most of the expressions will switch from error to undefined. As the b object has already been defined at this stage, it will state that it is of type Object. Expanding this will show it has one property (b) with the value of 7. Click the Step Into button, and watch as you step through each statement values get assigned to the variables being watched. Once the relevant variables are assigned a value you’ll see the expressions such as a.a + b.b will return the result of the executed expression. It this case it will return 10. As you can imagine, this feature can be very useful when trying to understand the current state of your application.

Globally override HTTP headers

It is now possible to globally override any HTTP header in Opera Dragonfly. Switch to the Network Inspector and then the Network options tab. There you can find an option to enable global network overrides. In the image above I've compared the result when overriding the user-agent header to Opera Mini on iPhone on the left and Safari on iPhone on the right. This shows the results of browser sniffing. In the first Opera gets a basic mobile site, and in the second it gets an advanced mobile app with features such as Google Instant. The global overrides apply to all network requests for the current session. As you can imagine, this is very useful for testing mobile optimised sites, or testing if pesky sites that block Opera actually work when the discrimination is bypassed.

Remote debug polish

We’ve also added some help text when the remote debug connection dialog is open. This steps the user through what needs to be done in Opera Dragonfly and the mobile device to connect the two.

Next steps

We’re gearing up to moving from the implementation phase to the polishing and bug fixing phase. In the near future we will stop working on new features and start getting Opera Dragonfly ready for the first stable release. In this phase we will fix critical bugs, along with polishing the UI to fix inconstancies and refine the look and feel. Once Dragonfly 1.0 is released we will move back to feature development along with further refining the currently supported features.

We hope you like the current build, and feedback is welcome as always.