This is what we do while running docker for local development with node.
The cleanest solution is to extend the dev pipeline with a proxy for localstack. It won't take me long to knock that out, but it's not something I can prioritize at the moment.
I agree with you that fixing the headers (via a proxy in this case) is the right solution. I'm just not able to prioritize right now.
Beyond that, there are always going to be occasions where developers, security analysts, and testers need to bypass default security enforcement. I'd like to see every browser provide a way to make these adjustments for a one-off session (e.g., via a command-line switch). It's an efficient solution that I can offer when I come across a nasty hack living permanently in a developer's web configuration.
If you're not a lone wolf, or working in the SV bubble, the IT and security departments are going to tell you to go pound sand.
CORS is allowed while running locally and then set while running in development and finally production.
I don't buy your comment at all.
I know this is beginning to become off-topic, but why? Presumably, if you're using a flag that has to be run from the command-line, you're either doing it on purpose or using hardware you don't own (and a keylogger is a much greater risk than anything else at that point)
In practice, it's not a problem for me, because the presence or absence of my usual row of extension icons and profile photo is enough of a clue.
But I could see where someone who doesn't normally sign into Chrome, or who doesn't have very many extensions in their normal Chrome profile, could have trouble distinguishing it from their a profile. The windows will tend to look pretty similar.
The problem I see is that not everyone takes the same precautions. And plenty of developers accumulate these sort of tweaks and hacks in their daily driver without realizing or remembering that they've crippled their own security posture.
From a UX perspective, my preference is to make it clear when normal security mechanisms are disabled.
Then you can change the theme for that profile which makes it obvious which instance you're using.
Is it for 3rd party domains and APIs or response that you control? Either way, controlling it in browser doesn't sound like the right way.
I have localhost.com in my hosts file and a local web server to run around it, but it's still really frustrating not being able to turn it off entirely.
If yes, you can setup different environments (dev, staging, production) and set CORS accordingly for each of them.
If no, how is it working in production?
I mostly have the setup you describe, and most development happens against a CORS-free staging server. But it's often necessary to build a local prod version that is identical to the live version for debugging or analysis, that plays against real players and reads/writes to the same data store.
It's an edge case, and in the past when I've done web development simply turning off CORS on staging has trivially solved any issues. But it does feel a bit like the developers of the browsers have chosen not to include the feature in a "we're smarter than you, trust us, you don't want this" kind of way. For the most part, they're probably right.
Just a wild idea that I haven't tried yet:
Would it work if you configure your etc/hosts to point production domain to localhost and open the production domain in the browser?
I'm gonna try this when I get free time.
I have found a few session manager options on Firefox but most suffer from permission bloat and poor UI.
Last I checked, there was nothing to make it easier to manage add-ons.
Chrome I can at least disable CORS via the command line, and Safari does it best by putting it in a Developer menu that I can easily toggle.
Firefox's dev tools also seem to still be behind — I haven't seen a good way to inspect WebSocket frames, for instance.
I would really prefer to use Firefox due to Mozzila's stances on privacy, especially in contrast to Google; however, I have to use the tool that lets me actually get work done.