{"id":1066,"date":"2012-03-31T09:59:56","date_gmt":"2012-03-31T13:59:56","guid":{"rendered":"http:\/\/yuguangzhang.com\/blog\/?p=1066"},"modified":"2012-12-05T15:11:19","modified_gmt":"2012-12-05T20:11:19","slug":"firefox-could-not-get-domain-for-worker","status":"publish","type":"post","link":"http:\/\/yuguangzhang.com\/blog\/firefox-could-not-get-domain-for-worker\/","title":{"rendered":"Firefox Could Not Get Domain for Worker"},"content":{"rendered":"<p>While wrapping up the <a href=\"http:\/\/fiddlesalad.com\">Fiddle Salad<\/a> project and doing cross browser testing, I found that Firefox wouldn&#8217;t run my project, at least on a local host.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1067\" title=\"screenshot.1\" src=\"http:\/\/yuguangzhang.com\/blog\/wp-content\/uploads\/2012\/03\/screenshot.1.png\" alt=\"\" width=\"446\" height=\"128\" srcset=\"http:\/\/yuguangzhang.com\/blog\/wp-content\/uploads\/2012\/03\/screenshot.1.png 446w, http:\/\/yuguangzhang.com\/blog\/wp-content\/uploads\/2012\/03\/screenshot.1-300x86.png 300w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><br \/>\nThis was one of the reasons I couldn&#8217;t get a stable release all in one shot. I initially thought it was caused by the IP address or the port number, but others report it&#8217;s just <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=683280\">a problem with not having a domain<\/a>. So one way is to add a domain <em>mydomain.co<\/em>m in the Windows host file in\u00a0C:\\Windows\\System32\\drivers\\etc.<br \/>\n[cc lang=&#8221;text&#8221;]<br \/>\n# Copyright (c) 1993-2009 Microsoft Corp.<br \/>\n#<br \/>\n# This is a sample HOSTS file used by Microsoft TCP\/IP for Windows.<br \/>\n#<br \/>\n# This file contains the mappings of IP addresses to host names. Each<br \/>\n# entry should be kept on an individual line. The IP address should<br \/>\n# be placed in the first column followed by the corresponding host name.<br \/>\n# The IP address and the host name should be separated by at least one<br \/>\n# space.<br \/>\n#<br \/>\n# Additionally, comments (such as these) may be inserted on individual<br \/>\n# lines or following the machine name denoted by a &#8216;#&#8217; symbol.<br \/>\n#<br \/>\n# For example:<br \/>\n#<br \/>\n#      102.54.94.97     rhino.acme.com          # source server<br \/>\n#       38.25.63.10     x.acme.com              # x client host<\/p>\n<p># localhost name resolution is handled within DNS itself.<br \/>\n\t127.0.0.1       localhost<br \/>\n\t127.0.0.1       myapp.com<br \/>\n[\/cc]<br \/>\nThe changes are applied immediately after saving, and I&#8217;m able to run the site locally in Firefox.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1072\" title=\"screenshot.3\" src=\"http:\/\/yuguangzhang.com\/blog\/wp-content\/uploads\/2012\/03\/screenshot.3.png\" alt=\"\" width=\"538\" height=\"211\" srcset=\"http:\/\/yuguangzhang.com\/blog\/wp-content\/uploads\/2012\/03\/screenshot.3.png 538w, http:\/\/yuguangzhang.com\/blog\/wp-content\/uploads\/2012\/03\/screenshot.3-300x117.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/p>\n<p>Another way is to use one of the Worker polyfills that bypasses the Firefox security checks. I suggest <a href=\"http:\/\/code.google.com\/p\/fakeworker-js\/\">fakeworker<\/a>, but in my case I would need to rewrite some code to be compatible with the old API to use it. Of course, this was only one of the many problems I found on the uploaded version, so I had to prioritize which problems to fix first. It&#8217;s always better to go for the efficiency gains at the start and visible results at the end. So I made a\u00a0<a href=\"http:\/\/blog.fiddlesalad.com\/django-media-sync-javascript-debug-processor\/\">Django media sync javascript debug processor<\/a> for future debug purposes on the production site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While wrapping up the Fiddle Salad project and doing cross browser testing, I found that Firefox wouldn&#8217;t run my project, at least on a local host. This was one of the reasons I couldn&#8217;t get a stable release all in one shot. I initially thought it was caused by the IP address or the port [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[4,146],"tags":[166,215,133,167],"class_list":["post-1066","post","type-post","status-publish","format-standard","hentry","category-firefox","category-pythonfiddle","tag-debugging","tag-firefox","tag-javascript","tag-web-worker"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/posts\/1066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/comments?post=1066"}],"version-history":[{"count":0,"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/posts\/1066\/revisions"}],"wp:attachment":[{"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/media?parent=1066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/categories?post=1066"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yuguangzhang.com\/blog\/wp-json\/wp\/v2\/tags?post=1066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}