Logo

dev-resources.site

for different kinds of informations.

Ways to create a new Chrome instance without CORS [macOS]

Published at
10/6/2019
Categories
debugger
chrome
terminal
cors
Author
munkacsimark
Categories
4 categories in total
debugger
open
chrome
open
terminal
open
cors
open
Author
12 person written this
munkacsimark
open
Ways to create a new Chrome instance without CORS [macOS]

This tutorial is mainly for macOS users, but the command line stuff can be useful for everyone.๐Ÿ˜Š

When you need to test your code in Chrome with default settings and without extensions, the --user-data-dir argument will be your friend. There is another flag for disable CORS: --disable-web-security. Before running the command, you might kill all Chrome instances.

From command line

Open your Terminal app and just run the following.

$ open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir=/tmp/chrome_dev_test --disable-web-security
Enter fullscreen mode Exit fullscreen mode

A new Application

On macOS you can easily create an Automator app, so open it, create a New Document then select the Application.
Screenshot from Automator app
After that, search for the Run Shell Script action and put the bash script from previous section inside it. Then save it with โŒ˜S.
Screenshot from Automator app

From Visual Studio Code debugger

First of all you need the Debugger for Chrome extension. In debug menu (โ‡งโŒ˜D) add a new configuration with Chrome target. Here you can set your localhost port and add new fields. In the configurations field should be the following. Then just save it and run it.๐Ÿš€

{
  "type": "chrome",
  "request": "launch",
  "name": "Launch Chrome against localhost",
  "url": "http://localhost:8080",
  "webRoot": "${workspaceFolder}",
  "userDataDir": "/tmp/chrome_dev_test",
  "runtimeArgs": ["--disable-web-security"],
  "sourceMaps": true
}
Enter fullscreen mode Exit fullscreen mode

Follow me here or on Twitter for random dev stuff like this.๐Ÿ˜

debugger Article's
30 articles in total
Favicon
A Comprehensive Guide to Debugging Go Code for Developers
Favicon
Top Java Debugging Tools for Efficient Application Development
Favicon
Mastering Debugging in C++: Techniques, Tools, and Best Practices for Developers
Favicon
Comprehensive Guide to Python Debugging Tools for Efficient Code Troubleshooting
Favicon
How to configure Delve (dlv) in VS Code
Favicon
Hover Console: Real-time JavaScript debugging directly on your webpage
Favicon
Debugging with breakpoints in ExUnit
Favicon
Precisamos falar sobre ipdb: Uma Jornada para um debugger mais Eficiente em Python
Favicon
Introduction to Debugging with React Developer Tools
Favicon
JavaScript Magic Tricks: Debugger Interception
Favicon
Streamlining Nodejs Error Debugging with Errsole Debugger: Node.js
Favicon
debugging in python for beginners
Favicon
Advance Free Debugger
Favicon
Setup ruby/debug with VSCode
Favicon
Integrating requestly mobile debugger in PostBook App
Favicon
HyperDbg: State-of-the-art native debugging tool
Favicon
Show properties of an object during the debug
Favicon
Debugging Swift in VS Code the old way
Favicon
Levelling up - 2: Use the debugger
Favicon
debug.gem blog: initial commit
Favicon
Become a Toolmaker
Favicon
3 steps to setup debugger for React Native app in WebStorm
Favicon
Kinx v0.19.3 Preview Released
Favicon
Debug Go with VIM
Favicon
Debugging As a Developer
Favicon
Ways to create a new Chrome instance without CORS [macOS]
Favicon
Stop Using Print and Die Statements
Favicon
Debugging Python applications (plus free cheat sheet)
Favicon
Dude, get a debugger!
Favicon
Introduction of LLDB

Featured ones: