How do you temporarily disable the Same-Origin Policy in Chrome for local testing?
Launch a separate Chrome instance from your terminal with **–disable-web-security** and a dedicated **–user-data-dir`** flag. Never browse regular websites in this insecure test window.
Launch Isolated Chrome Test Instance
# Windows (Command Prompt)
"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\chrome-dev-session"
# macOS (Terminal)
open -na "Google Chrome" --args --disable-web-security --user-data-dir="/tmp/chrome-dev-session"
# Linux (Terminal)
google-chrome --disable-web-security --user-data-dir="/tmp/chrome-dev-session"
##Important Warning
Close all regular Chrome windows first or provide a unique --user-data-dir path, otherwise Chrome ignores the flag and opens a tab in your existing session.'
You must log in or register to comment.
