Logo

dev-resources.site

for different kinds of informations.

How to Launch Google Chrome Without CORS Protection on macOS

Published at
9/20/2024
Categories
macos
cors
chrome
Author
benarambide
Categories
3 categories in total
macos
open
cors
open
chrome
open
Author
11 person written this
benarambide
open
How to Launch Google Chrome Without CORS Protection on macOS

How to Launch Google Chrome Without CORS Protection on macOS

If you're a developer or testing applications that require disabling CORS (Cross-Origin Resource Sharing), you can easily launch Google Chrome without its CORS protections. This guide will show you how to create a simple command to do this on macOS.

Steps to Launch Chrome Without CORS Protection

1. Close Any Running Instances of Chrome

Before starting, ensure that all instances of Google Chrome are closed.

2. Open Terminal

You can find Terminal in Applications > Utilities > Terminal\.

3. Create a Shell Script

In the Terminal, create a new shell script by running:

nano ~/chrome-dev
Enter fullscreen mode Exit fullscreen mode

4. Add the Launch Command

In the nano editor, add the following lines:

#!/bin/bash
open -na "Google Chrome" --args --disable-web-security --user-data-dir="/tmp/chrome_dev"
Enter fullscreen mode Exit fullscreen mode

This script opens a new instance of Chrome with CORS disabled.

5. Save and Exit

Press CTRL + X\, then Y\, and hit Enter\ to save the file.

6. Make the Script Executable

Run the following command to make your script executable:

chmod +x ~/chrome-dev
Enter fullscreen mode Exit fullscreen mode

7. Add to Your PATH (Optional)

To run the command from anywhere in the terminal, you can add it to your PATH.

Open your profile file:

  • For bash users:
  nano ~/.bash_profile
Enter fullscreen mode Exit fullscreen mode
  • For zsh users:
  nano ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Add the following line to the file:

export PATH="$HOME:$PATH"
Enter fullscreen mode Exit fullscreen mode

Save and exit, then refresh your terminal:

  • For bash:
  source ~/.bash_profile
Enter fullscreen mode Exit fullscreen mode
  • For zsh:
  source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Using the Command

You can now use the command chrome-dev\ in your terminal to launch Chrome without CORS protection.

Important Reminder

Disabling CORS makes your browser less secure. Use this mode strictly for development and testing purposes, and remember to return to normal browsing afterward.

Conclusion

This simple script can save you time when testing applications that require CORS to be disabled. Just remember to use it responsibly!

cors Article's
30 articles in total
Favicon
Cookies auto clearing after browser refresh issue , CORS related express cookies issue
Favicon
What is CORS Error and how to fix it
Favicon
CORS in Spring Boot with Kotlin
Favicon
Understanding CORS: Why Your API Requests Are Failing 🚧
Favicon
How to Launch Google Chrome Without CORS Protection on macOS
Favicon
Cross-Origin Resource Sharing (CORS): A Comprehensive Guide
Favicon
CORS is Stupid
Favicon
roadauth-rails api jwt cors 2024
Favicon
What is the CORS ?
Favicon
Fixing CORS in your SPA
Favicon
Advanced CORS: Deep Dive into Cross-Origin Resource Sharing
Favicon
Third-Party Cookies Are Gone (Or Not). How Can I Still Embed Cross-Site Apps?
Favicon
SOLVING CORS ERROR
Favicon
Troubleshooting CORS Issues in Express.js: A Simple Misconfiguration
Favicon
Implementing CORS in a Custom Next.js Server
Favicon
What are CORS? and how to configure it in Node?
Favicon
Brewing a More Open Web: CORS Demystified
Favicon
CORS Error Explained and How to Fix It?
Favicon
Resolving CORS Issues in express Node.js Project
Favicon
Resolving Firebase Authentication Sign-in Method Error
Favicon
Problem Encountered with CORS in Deno Server
Favicon
Solving CORS errors with Appwrite
Favicon
Need Help: Cross-Origin-Opener-Policy Blocking Google Login Window.Closed Call
Favicon
Understanding CORS, CSRF attacks and enabling valid CORS
Favicon
Enabling CORS in a .NET Core Server-Side Application
Favicon
[SOLVED]Yet another docker + vite, The connection was reset
Favicon
Cross-Origin Resource Sharing (CORS)
Favicon
Modern API development(Part 2): Initialize Server
Favicon
Configurando CORS Global para API Springboot
Favicon
Understand CORS 🌐 in Easy Way🦾

Featured ones: