Hacker News new | ask | show | jobs
by user_7832 860 days ago
I'm not able to understand, what might be the utility of doing so?
3 comments

I once had to debug a sporadic problem in a prod system I wasn't familar with, which seemed to be caused by two requests made simultaneously by different users. I could have assembled curl commands but the easiest thing to reproduce and verify the issue was to run a setTimeout(clickSubmit, 5s) in both browser session's consoles. Weirdly niche use case, but something like this extension would've been useful.
You can also copy curl command right from the browser network tab, to recreate the request.
I don't know of a reliable way of calling two separate curl commands at once though. Maybe abusing the shell job system, or learning the 'at' command. It has been a while since I've needed to do something like this.
Why abuse? That's what it's for. I'd just copy paste the curl line into a script file several times and put & at the end of each line.

Then end the script with wait command and run the script.

if curl & curl is too slow, try using gnu/parallel.
Oh I don't know, I could see it being useful it it's possible to hook up with rtk-query or react-query, to prevent duplicate requests from multiple instances of an app that might be running.

Though I guess this might just trigger all the requests on all that tabs anyway. I suppose you'd have to add architecture to start one instance of that app as the 'controller' and then a way to pass off controller responsibilities to other tabs... which sounds like basically "step 2: draw the rest of the owl"

Since I just noticed this is an extension rather than a library, I think it's probably more useful for automating interactions with a number of tabs of the same page (but puppeteer or something similar would probably be a better fit for this also)

For cross-tab communications, there are better APIs, like https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_C...

For user-driven automations, something like Tampermonkey would be way better (and safer, since they can be domain-limited).

I can think of no reason why a regular user would want to allow tabs to execute each other's code... that just seems like a setup for self-XSS attacks by people who don't know any better :(

---------

edit: Sorry, re: the second part of your comment, I misunderstood what you meant. Like if you wanted to purposely script multiple identical tabs at the same time.

Could be an alternative to Puppeteer/Playwright for automating a browser.