0

I have font in my local space and try to change my html font with css @font-face and it worked on any browser, except firefox. It's just a simple html and css file and i don't have any server like apache.

How should i fix it?

@font-face {
  font-family: 'iransans';
  src:   url('../fonts/IRANSansWeb.woff2') format('woff2'),
         url('../fonts/IRANSansWeb.woff') format('woff'),
         url('../fonts/IRANSansWeb.eot') format('embedded-opentype'),
         url('../fonts/IRANSansWeb.ttf') format('truetype');
}

i got this error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///P:/workspace/karAmuzi/karamuzi%20project%201/fonts/IRANSansWeb.woff2. (Reason: CORS request not http).

Will Paiz
  • 75
  • 1
  • 6
sadegh17
  • 3
  • 2
  • 1
    Possible duplicate of [why does @font-face work on safari and not on firefox? (Mac versions)](https://stackoverflow.com/questions/3439214/why-does-font-face-work-on-safari-and-not-on-firefox-mac-versions) – mullac Jul 17 '19 at 02:02

1 Answers1

1

It is because of some security policy for Firefox browsers. It has a simple solution of disabling that policy. Search about:config in address bar. It will show a warning about voiding the browser's warranty and making it unstable. Take that risk. Now in the page search security.fileuri.strict_origin_policy and double click on it to turn its boolean value to false. This should solve your problem.

  • Welcome to StackOverflow! Not all questions should be answered. Take a look at the question Callum linked as a possible original question: If every valid answer to that questing solves the problem here, this one shouldn't get answers. If you have something to add to the answers to the original, by all means do. – greybeard Jul 20 '19 at 04:56