Search code examples
htmlcssfirefoxfonts

Cross-Origin Request Blocked when loading local file


I am currently developing a website and have trouble showing my font-icons in firefox. every browser except for firefox can load and show my font-icons, but on firefox I get the following error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/Users/Me/Desktop/website/resources/dist/css/fonts/themify.ttf. (Reason: CORS request not http).

the path of the file is correct, as the browser lets me download the file when I enter the above listed URL. Anybody knows why I get this error?


Solution

  • As mentioned in the comment section, I installed a web server. In my case I used tomcat8 and using that I was able to display the icons even in firefox.