{"id":228,"date":"2009-03-03T15:59:26","date_gmt":"2009-03-03T20:59:26","guid":{"rendered":"http:\/\/mikeconley.ca\/blog\/?p=228"},"modified":"2023-12-20T16:25:21","modified_gmt":"2023-12-20T21:25:21","slug":"parts-of-firefoxcoded-in-javascript-news-to-me","status":"publish","type":"post","link":"https:\/\/mikeconley.ca\/blog\/2009\/03\/03\/parts-of-firefoxcoded-in-javascript-news-to-me\/","title":{"rendered":"Parts of Firefox&#8230;coded in JavaScript?  News to me&#8230;"},"content":{"rendered":"<p>So, maybe I&#8217;m about to state the obvious here, but believe it or not, parts of Mozilla Firefox are <strong>coded in JavaScript<\/strong>.<\/p>\n<p>JavaScript?\u00a0 Powering Firefox?\u00a0 Holy smokes, I had absolutely no idea.<\/p>\n<p>Let me back up for a minute.<\/p>\n<p>There&#8217;s a very small possibility that I&#8217;m going to be working with Mozilla for Google Summer of Code this year, so I downloaded the Firefox code base to take a look at what their code looks like.<\/p>\n<p>And it looks good.\u00a0 Really good.\u00a0 Clearly, the guys at Mozilla are pros.<\/p>\n<p>So I was digging around in the source code, and in the folder mozilla\/browser\/base\/content\/browser.js, there is a <strong>JavaScript<\/strong> file that essentially details how Firefox behaves.<\/p>\n<p>Look &#8211; here&#8217;s the function that handles when a new tab is opened in Firefox:<\/p>\n<pre>function BrowserOpenTab()\r\n{\r\n\u00a0 if (!gBrowser) {\r\n\u00a0\u00a0\u00a0 \/\/ If there are no open browser windows, open a new one\r\n \u00a0\u00a0 window.openDialog(\"chrome:\/\/browser\/content\/\", \"_blank\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"chrome,all,dialog=no\", \"about:blank\");\r\n\u00a0\u00a0\u00a0 return;\r\n\u00a0 }\r\n\u00a0 gBrowser.loadOneTab(\"about:blank\", null, null, null, false, false);\r\n  if (gURLBar)\r\n\u00a0\u00a0\u00a0 gURLBar.focus();\r\n}<\/pre>\n<p><strong>JavaScript<\/strong>.\u00a0 My mind is starting to get blown here, and I&#8217;m getting excited by the possibilities &#8211; seeing as how I&#8217;ve grown quite comfortable with JavaScript over the years.<\/p>\n<p>And it&#8217;s all thanks to the Mozilla framework, apparently.\u00a0 I&#8217;m only scratching the surface here, but I&#8217;m really interested in this, and I&#8217;ll post more as I learn it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, maybe I&#8217;m about to state the obvious here, but believe it or not, parts of Mozilla Firefox are coded in JavaScript. JavaScript?\u00a0 Powering Firefox?\u00a0 Holy smokes, I had absolutely no idea. Let me back up for a minute. There&#8217;s a very small possibility that I&#8217;m going to be working with Mozilla for Google Summer [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[5,68,79],"tags":[125,1212,35],"class_list":["post-228","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-javascript","category-technology","tag-firefox","tag-javascript","tag-mozilla"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prmTy-3G","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/228","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=228"}],"version-history":[{"count":8,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":3258,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/228\/revisions\/3258"}],"wp:attachment":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}