{"id":374,"date":"2009-04-27T19:15:18","date_gmt":"2009-04-28T00:15:18","guid":{"rendered":"http:\/\/mikeconley.ca\/blog\/?p=374"},"modified":"2023-12-20T16:25:21","modified_gmt":"2023-12-20T21:25:21","slug":"summer-project-firefox-plugin-to-override-window-alert","status":"publish","type":"post","link":"https:\/\/mikeconley.ca\/blog\/2009\/04\/27\/summer-project-firefox-plugin-to-override-window-alert\/","title":{"rendered":"Summer Project:  Firefox Plugin to Override Window.Alert"},"content":{"rendered":"<p>When I don&#8217;t have work to do, I get antsy.<\/p>\n<p>And right now, I&#8217;ve got no work to do.<\/p>\n<p>So I&#8217;ve come up with a project for myself:\u00a0 <a href=\"http:\/\/mikeconley.ca\/blog\/2009\/03\/05\/making-my-first-firefox-extension-before-5pm-today\/\">remember how I created a Firefox Plugin a few months back?<\/a>\u00a0 I&#8217;d like to make another one &#8211; but this one will actually serve a useful purpose.<\/p>\n<p>Have you ever been to a page that suddenly started spewing window.alert boxes at you?<\/p>\n<p>If you haven&#8217;t, open up Firebug, and paste this into the console:<\/p>\n<pre><span class=\"objectBox objectBox-text\">for(i = 0; i &lt; 10; ++i){ alert(i); }<\/span><\/pre>\n<p>Now imagine if instead of 10 alert boxes, it spewed hundreds&#8230;or thousands&#8230;.or god forbid, it uses a while(true) loop, and throws infinity alert boxes at you.<\/p>\n<p>It totally cripples Firefox. It&#8217;s a super simple browser DoS attack.<\/p>\n<p><a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=59314\">Mozilla knows this<\/a>, but so far, no solution except for killing the Firefox process, or disabling Javascript manually, or with <a href=\"http:\/\/noscript.net\/\">NoScript<\/a> (a plugin that I highly recommend).<\/p>\n<p>Google Chrome has solved this problem by <a href=\"http:\/\/blog.spathare.com\/2009\/02\/chrome-prevents-javascript-alert-loop\/\">providing a checkbox on alert dialogs that allow a user to disable future popups from the current site<\/a>.<\/p>\n<p>Cool.\u00a0 I want Firefox to have the same feature.<\/p>\n<p>So, this summer, I&#8217;m going to <em>try <\/em>to build a Firefox Plugin that will override the standard window.alert function, with one that provides a checkbox, letting the user disable future alerts.<\/p>\n<p>I don&#8217;t even know if this is possible, but I&#8217;m looking into it.<\/p>\n<p>I&#8217;ll blog my research and progress as I go along, and share my code \/ final plugin when it&#8217;s all finished (or when I abandon it&#8230;hey, it happens).<\/p>\n<p>So stay tuned.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I don&#8217;t have work to do, I get antsy. And right now, I&#8217;ve got no work to do. So I&#8217;ve come up with a project for myself:\u00a0 remember how I created a Firefox Plugin a few months back?\u00a0 I&#8217;d like to make another one &#8211; but this one will actually serve a useful purpose. [&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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[380,5,220,44,68,51,79],"tags":[207,208,125,1212,35,206],"class_list":["post-374","post","type-post","status-publish","format-standard","hentry","category-alertcheck-firefox-extensions-technology","category-computer-science","category-firefox-extensions","category-internet","category-javascript","category-security","category-technology","tag-alert","tag-dos","tag-firefox","tag-javascript","tag-mozilla","tag-plugin"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prmTy-62","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/374","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=374"}],"version-history":[{"count":4,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/374\/revisions"}],"predecessor-version":[{"id":672,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/374\/revisions\/672"}],"wp:attachment":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/media?parent=374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/categories?post=374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/tags?post=374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}