shawncun Posted January 10 Posted January 10 Is it possible to add a CORS header to allow me to use a hosted JS file for a Chrome extension?
wolstech Posted January 11 Posted January 11 Not sure if this is possible for a plain js file. Krydos would know more. I know for PHP, people have done it with header(), so I guess worst case you could make a PHP file that sends your headers (content-type is the minimum, and in your case obviously the CORS headers), then just call readfile() to spit out the js.
Krydos Posted January 11 Posted January 11 You can set CORS headers with .htaccess Header set Access-Control-Allow-Origin "https://example.com"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now