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!

chrome Article's
30 articles in total
Favicon
Test your website in different Timezone
Favicon
Chrome starts to look cute now with its new Chrome MV
Favicon
The latest version of Chrome browser enable the solidWorks 3D ActiveX control
Favicon
Deploy Puppeteer As a Serverless API: Solutions Compared
Favicon
🎄 Instant Local Translation with Chrome 🌐
Favicon
8 AI-Powered Chrome Extensions to Save Hours of Manual Work 🧙‍♂️
Favicon
🔅 Adjust Page Brightness: Take Control of Your Screen's Luminosity
Favicon
The Best Chrome Heart Jeans for a Luxe Casual Look
Favicon
FREE: Password Generator ⚡ PRO (extension/add-on) + [source code]
Favicon
Chrome OS Guide to go from Zero to DevOps Hero in a nutshell
Favicon
Avoiding a "Host Permission" Review Delay When Publishing a Chrome Extension
Favicon
How to disconnect WebSocket from Chrome Developer tool
Favicon
How to Choose the Best Free VPN Chrome Extension for Your Needs
Favicon
Chrome Hearts Shirts: A Fusion of Luxury and Streetwear
Favicon
JSON Viewer Plus: The Last JSON Extension You'll Ever Need
Favicon
9 AI-Powered Chrome Extensions to Save Hours of Manual Work 🧙‍♂️🔥
Favicon
How to Run Google Chrome without CORS Error
Favicon
From WHOIS to SSL: How DNS Checker Pro Unveils the Hidden Details of Any Website
Favicon
How to Publish a Chrome Extension
Favicon
How to Launch Google Chrome Without CORS Protection on macOS
Favicon
Exclusive Chrome Hearts Ring: Unique Design for Bold Style
Favicon
Live Captions!
Favicon
Capture Browser XHR/Fetch API Response Automatically into JSON Files
Favicon
Learn Spanish Chrome extension
Favicon
17 Lesser Known Chrome Extensions You Wish You Knew Sooner 🤩⚡
Favicon
Resolving Issues from Unexpected Changes to `container-type: inline-size` in Chrome 129
Favicon
20 Best Chrome Extensions for Developers in 2024
Favicon
Going beyond the classic console.log
Favicon
How to create a Chrome extension
Favicon
Top 10 must have Chrome extension for webdevelopers

Featured ones: