Skip to content

Bypass CORS to fetch files when working with localhost

Published:

1 min read

Sometime back I learned about opening files or directories using the open command from the CLI on a Mac. It’s simple yet effective.

Another use case that I’ve been using it for is to open the current project when in localhost in the browser and bypass the CORS policy to fetch files that are also available locally.

open -a "Google Chrome Canary"  --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security

The argument passed in the above command overrides the browser’s default behavior.


Previous Post
How to clear global npx cache
Next Post
Setup Macbook M1 for Web and React Native development

I'm a software developer and technical writer. On this blog, I share my learnings about both fields. Recently, I have begun exploring other topics, so don't be surprised if you find something new here.

Currently, working as a documentation lead at Expo.