JavaScript on Firebase Hosting to Webflow - CORS Error

Hey there!

I am trying to implement externally hosted (Firebase Hosting) javascript files to my webflow project.

When executed, the console says the following:
Access to fetch at “https://x” from origin ‘X’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Since i can’t edit the htaccess in webflow, is there any way to load external javscript files?

Here are two resources to help you address this. First you need to understand why you are getting the message and where you need to control it…

Then how to use custom headers with firebase hosting … Configura el comportamiento del Hosting  |  Firebase Hosting

Feel free to check out this repo that I built.

The Firebase.json file here should take care of your needs. Feel free to tweak it to only allow your webflow website, since the default allow all origins to access the files.