{"id":2697,"date":"2015-04-02T21:17:17","date_gmt":"2015-04-03T02:17:17","guid":{"rendered":"http:\/\/mikeconley.ca\/blog\/?p=2697"},"modified":"2023-12-20T16:25:11","modified_gmt":"2023-12-20T21:25:11","slug":"the-joy-of-coding-ep-8-view-source-hacking","status":"publish","type":"post","link":"https:\/\/mikeconley.ca\/blog\/2015\/04\/02\/the-joy-of-coding-ep-8-view-source-hacking\/","title":{"rendered":"The Joy of Coding (Ep. 8): View Source Hacking"},"content":{"rendered":"<p>In this episode, I again started with some code review. <a href=\"https:\/\/reviewboard.mozilla.org\/r\/6411\/\">I reviewed this patch<\/a> for <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1148807\">this bug<\/a> by fellow Firefox hacker Gijs, and refreshed my memory on <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Statements\/var?redirectlocale=en-US&amp;redirectslug=JavaScript%2FReference%2FStatements%2Fvar#var_hoisting\">var hoisting<\/a>. I&#8217;ve been using <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Statements\/let\">let<\/a> for so long that it was really, really weird to see how var worked.<\/p>\n<p>After that, I quickly gave an update on my <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1110887\">plugin crash UI bug<\/a> I had been working on the last episode &#8211; <a href=\"https:\/\/reviewboard.mozilla.org\/r\/5701\/\">the patches are up<\/a>, and are currently undergoing review, so there wasn&#8217;t much to do there.<\/p>\n<p>Next, I started on a <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1025146\">brand new bug<\/a><sup id=\"rf1-2697\"><a href=\"#fn1-2697\" title=\"I say brand new, except that, as I explain in the video, I had already attacked this bug early on in my e10s work, and had only recently come back to it.\" rel=\"footnote\">1<\/a><\/sup>, explained the bug<sup id=\"rf2-2697\"><a href=\"#fn2-2697\" title=\"The View Source tool sometimes re-retrieves the source off of the network when opened from an e10s-browser\" rel=\"footnote\">2<\/a><\/sup>, and then laid out my plan for attacking it.<\/p>\n<p>Specifically, I&#8217;m going to try an experiment: <strong>I will only be working on that bug during Joy of Coding sessions. <\/strong>That way, there is continuity from video to video, and you won&#8217;t miss any of the development that goes on between episodes.<\/p>\n<p>We sliced off a chunk to get done, and hit some minor roadblocks (as expected). The View Source code is old and crufty, and I have to do my best to make sure I don&#8217;t break any of the other applications that depend on it (like Thunderbird and SeaMonkey).<\/p>\n<p>So that was the name of the game &#8211; looking to see how other applications use View Source, and trying to come up with a plan for making sure we don&#8217;t break them, while at the same time refactoring View Source to be easier to code against (and work with <a href=\"https:\/\/developer.mozilla.org\/en-US\/Firefox\/Multiprocess_Firefox\/The_message_manager#Loading_frame_scripts\">a frame script and messages<\/a>).<\/p>\n<p>It was a long slog<sup id=\"rf3-2697\"><a href=\"#fn3-2697\" title=\"My longest episode ever, clocking in at over 2.5 hours.\" rel=\"footnote\">3<\/a><\/sup>, but we got to a good point by the end. Let&#8217;s see how far we get next week!<\/p>\n<p><a href=\"https:\/\/www.evernote.com\/l\/AbLRkg-z0K5KEJqVYcuxnwzylaLlWuZqPEY\">Episode Agenda<\/a><\/p>\n<h2>References<\/h2>\n<p><a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1148807\">Bug 1148807 &#8211; Method moveToAlertPosition in dialog.xml should check if opener is not null<\/a><\/p>\n<p><a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1110887\">Bug 1110887 &#8211; With e10s, plugin crash submit UI is broken<\/a> &#8211; <a href=\"https:\/\/www.evernote.com\/shard\/s434\/sh\/cbf01ebf-abe3-40e3-969c-5bbc1e1eddb2\/909d6f1ae89a2d00\">Notes<\/a><\/p>\n<p><a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1025146\">Bug 1025146 &#8211; [e10s] Never load the source off of the network when viewing source<\/a> &#8211; <a href=\"https:\/\/www.evernote.com\/l\/AbKJ3Z1m90ZLuZuThyXIsGaLuRi-dHUmETg\">Notes<\/a><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/air.mozilla.org\/the-joy-of-coding-mconley-livehacks-on-firefox-episode-8\/video\/\" width=\"896\" height=\"524\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<hr class=\"footnotes\"><ol class=\"footnotes\" style=\"list-style-type:decimal\"><li id=\"fn1-2697\"><p >I say brand new, except that, as I explain in the video, I had already attacked this bug early on in my e10s work, and had only recently come back to it.&nbsp;<a href=\"#rf1-2697\" class=\"backlink\" title=\"Return to footnote 1.\">&#8617;<\/a><\/p><\/li><li id=\"fn2-2697\"><p >The View Source tool sometimes re-retrieves the source off of the network when opened from an e10s-browser&nbsp;<a href=\"#rf2-2697\" class=\"backlink\" title=\"Return to footnote 2.\">&#8617;<\/a><\/p><\/li><li id=\"fn3-2697\"><p >My longest episode ever, clocking in at over 2.5 hours.&nbsp;<a href=\"#rf3-2697\" class=\"backlink\" title=\"Return to footnote 3.\">&#8617;<\/a><\/p><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>In this episode, I again started with some code review. I reviewed this patch for this bug by fellow Firefox hacker Gijs, and refreshed my memory on var hoisting. I&#8217;ve been using let for so long that it was really, really weird to see how var worked. After that, I quickly gave an update on [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[454,5,874,1117,861],"tags":[501,1108,1069,125,1103,35,1125,1126],"class_list":["post-2697","post","type-post","status-publish","format-standard","hentry","category-code-reviews","category-computer-science","category-firefox-mozilla-2","category-livecoding","category-mozilla-2","tag-code-review","tag-cpow","tag-e10s","tag-firefox","tag-livehacking","tag-mozilla","tag-var-hoisting","tag-view-source"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prmTy-Hv","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/comments?post=2697"}],"version-history":[{"count":1,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2697\/revisions"}],"predecessor-version":[{"id":2698,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2697\/revisions\/2698"}],"wp:attachment":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/media?parent=2697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/categories?post=2697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/tags?post=2697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}