How to allow geopositing in Intellij Idea and apply chrome flags "unsafely-treat-insecure-origin-as-secure"

302 views Asked by At

Is there a way to pass development browser flags in IntelliJ Idea (or WebStorm) ? (as it is in chrome "unsafely-treat-insecure-origin-as-secure" StackOverflow answer)

IntelliJ IDEA react-app config

If I try to get user geolocation with

navigator.geolocation.watchPosition

I get this error and it doesn't allow me to debug my webapp directly from IntelliJ

geolocation unsafe origin error

But I successfully debug it in Chrome in dev tools

Seems to be in IntelliJ there is no place to add dev-flags

1

There are 1 answers

5
LazyOne On BEST ANSWER

Settings (Preferences on macOS) | Tools | Web Browsers

Go there, find your browser (or just create your own custom entry) and add command line arguments or select custom data directory (that points to existing user profile) there.

enter image description here

To ensure that those flags/params will be applied you would need to have that browser closed when launching your Run/Debug Configuration.

In your case you should add --unsafely-treat-insecure-origin-as-secure="http://192.168.1.101:3000" or any other flag separated with a space.