New Firebug 1.5 & Debugging Cookies
by Honza- Published:January 20th, 2010
- Comments:7 Comments
- Category:Firebug, Firecookie, Planet Mozilla
Several posts already announced fresh new release of Firebug 1.5 (!) and so, let me focus on one new cool feature that comes with the combo Firebug 1.5 + Firecookie 1.0.
Firecookie is an extension to Firebug that allows managing cookies in your browser. Latest 1.0v has been also just released on AMO and it's fully compatible with Firebug 1.5.
Since Firebug 1.5, introduces a new Break on next feature (among other things) that can be used to break Javascript execution on various events (e.g. on XHR) fired by the current page, it was straightforward that this can be also useful for debugging cookies.
Break On Cookie Change
The purpose of the feature is to break JS execution when a cookie on the current page is modified and show the Javascript source line that caused it (using the Script panel). This is useful especially in cases when the developer doesn't entirely know the source code (perhaps written by somebody else) and wants quickly find the related piece of code.
To activate the feature, select the Cookies panel and click on Break On Cookie Change button.
As soon as a cookie on the current page is modified, Firebug debugger halts and the Script panel is activated.
Cookie Breakpoint
If the developer is interested only in one specific cookie, a cookie breakpoint can be created by clicking on the breakpoint column, just like in case of a regular JS breakpoint.
So, if this particular cookie is modified the debugger stops JS execution showing what line of source code is the culprit.
Conditional Breakpoint
In order to break only under some circumstances, a breakpoint condition can be specified. Just right click on the breakpoint to show a condition editor.
The breakpoint will stop only if the expression is evaluated to true. Note that you can use following cookie properties in the expression (as built in variables): value, path, host, expires [ms], isHttpOnly, isDomain.
7 Comments
[...] Software is hard | New Firebug 1.5 & Debugging Cookies http://www.softwareishard.com/blog/firebug/new-firebug-15-debugging-cookies – view page – cached More musings on software development [...]
Awesome! Thanks for your hard work Honza!
[...] Software is hard | New Firebug 1.5 & Debugging Cookies [...]
Very Cool!!
[...] Software is hard | New Firebug 1.5 & Debugging Cookies [...]
[...] I’ve been using Firebug 1.5 since it was an alpha and now I’m using Firebug 1.6 alpha with Firefox 3.6. I’ve been also using Firecookie for a very long time now, but never realized about this: you can put breakpoints on cookies to detect changes! [...]
[...] New Firebug 1.5 & Debugging Cookies January 20, 2010 By Jan Odvarko [...]