hoppscotch / hoppscotch-extension

🧩 Browser extensions to provide more capabilities to https://hoppscotch.io
https://hoppscotch.io
MIT License
254 stars 95 forks source link

Add localhost in the active origin by default #258

Closed lallenfrancisl closed 8 months ago

lallenfrancisl commented 9 months ago

http://localhost should be in the default active origins. It's so confusing that when someone new comes its not working immediately for localhost connections. I am someone who has been using this from the beginning, but even then had to search the issues because I was setting up my new laptop and forgot about this problem

Browser: Firefox 122 (Linux)

liyasthomas commented 9 months ago

This makes sense.

AndrewBastin commented 8 months ago

Why should localhost be added as a default origin ? What is your usecase where you ran into this requirement ?

Since this extension does provide a mechanism to override the intended security restrictions of the browser, we are very conservative on terms of what options should be applied.

lallenfrancisl commented 8 months ago

@AndrewBastin So my issue was that I tried to use hoppscotch by just installing the extension and when I tried to make a request to the localhost using the extension it showed cannot send request. So I added localthost to the allowed origins and it worked. So my point is that it should work by default for localhost otherwise it will be confusing for new users

AndrewBastin commented 8 months ago

@lallenfrancisl the origin list doesn't define which origins requests can be sent to. Rather, it defines what all origins can the extension connect to (for example, if you are selfhosting Hoppscotch, you are not going to be having hoppscotch.io as the domain).

When you install the extension while Hoppscotch is running, there are sometimes situations where the extension doesn't register with Hoppcotch. Usually creating a new Hoppscotch tab or restarting the browser usually fixes the issue. I believe you might have had that happen to you.

Can you verify this by using extension in hoppscotch.io without the localhost entry present in the origin list ? You will still be able to hit localhost endpoints.

AndrewBastin commented 8 months ago

Closing this issue as invalid. Please do reopen if you have more queries.

Also closing the associated PR.