{"id":167,"date":"2013-10-25T12:18:29","date_gmt":"2013-10-25T10:18:29","guid":{"rendered":"http:\/\/www.gijsk.com\/blog\/?p=167"},"modified":"2013-10-25T12:18:29","modified_gmt":"2013-10-25T10:18:29","slug":"debugging-chrome-js-and-mochitests-redux","status":"publish","type":"post","link":"https:\/\/www.gijsk.com\/blog\/2013\/10\/debugging-chrome-js-and-mochitests-redux\/","title":{"rendered":"Debugging chrome JS and mochitests &#8211; redux"},"content":{"rendered":"<p>About a month ago I posted about <a title=\"Debugging chrome JS and mochitests\" href=\"http:\/\/www.gijsk.com\/blog\/2013\/09\/debugging-chrome-js-and-mochitests\/\">debugging chrome JS and mochitests<\/a>. Since then, we&#8217;ve done a fair bit to improve the situation, and so I figured an update was in order (I&#8217;ve posted some of this to fx-dev and m.d.platform already, so apologies if you&#8217;re reading this twice). In particular:<\/p>\n<ul>\n<li>After updating your chrome\/remote debugging settings, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=917706\">no restart or new window is required anymore<\/a> to start debugging, and the notes that say so <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=918240\">are gone, too<\/a>. So all you\u00a0 need to do is toggle the required settings, and open the debugger from the menu.<\/li>\n<li>As of today&#8217;s nightly (still building) you&#8217;ll be able to use the <code>--jsdebugger<\/code> flag <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=895471\">to start the browser debugger on browser startup<\/a>. (with many thanks due to Panos for <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=929540\">fixing an issue<\/a> that stopped this, as well as &#8211;jsconsole, from working on Nightly builds, but not self-compiled builds)<\/li>\n<li>As of just now, mach on mozilla-central supports using the aforementioned flag with mochitests as well, and you can debug your mochitests in one easy command:\n<pre>.\/mach mochitest-browser --jsdebugger &lt;my-test(s)&gt;<\/pre>\n<p>The test framework takes care of setting the required prefs in the freshly created profile, &#8211; you won&#8217;t even be prompted to allow the connection &#8211; and will wait with running the tests so you have time to set breakpoints etc.<\/li>\n<\/ul>\n<p>Happy debugging!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>About a month ago I posted about debugging chrome JS and mochitests. Since then, we&#8217;ve done a fair bit to improve the situation, and so I figured an update was in order (I&#8217;ve posted some of this to fx-dev and &hellip; <a href=\"https:\/\/www.gijsk.com\/blog\/2013\/10\/debugging-chrome-js-and-mochitests-redux\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-167","post","type-post","status-publish","format-standard","hentry","category-mozilla"],"_links":{"self":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/167"}],"collection":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/comments?post=167"}],"version-history":[{"count":1,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/167\/revisions"}],"predecessor-version":[{"id":168,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/167\/revisions\/168"}],"wp:attachment":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/media?parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/categories?post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/tags?post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}