This pull request aims to fix the issue that has been bugging me as a user of Hoppscotch for a while. The problem lied with how cookies were handled, where any cookie specified in the Hoppscotch request would be deleted from my browser after the request finished. I disagree with it working like that, as I believe the extension should leave my browser as untouched as possible.
This was especially a problem when developing and testing one of my backends before I knew this behavior existed, and has cost me more time than I'd like to admit trying to figure out why my session cookies were disappearing lol.
The Fix
This modifies the way cookies are handled by the removeRequestCookies, by instead modifying it so pre-request we remember the state of the cookies before we change them. This lets the removeRequestCookies go through all modified cookies and return them to their original state as best as it can.
Other Things
Added a format script to package.json to better make use of prettier
Note: I have never touched the Chrome Extensions API before so apologies in advance for any oversights. I have not tested for Firefox.
The Problem
This pull request aims to fix the issue that has been bugging me as a user of Hoppscotch for a while. The problem lied with how cookies were handled, where any cookie specified in the Hoppscotch request would be deleted from my browser after the request finished. I disagree with it working like that, as I believe the extension should leave my browser as untouched as possible.
This was especially a problem when developing and testing one of my backends before I knew this behavior existed, and has cost me more time than I'd like to admit trying to figure out why my session cookies were disappearing lol.
The Fix
This modifies the way cookies are handled by the
removeRequestCookies
, by instead modifying it so pre-request we remember the state of the cookies before we change them. This lets theremoveRequestCookies
go through all modified cookies and return them to their original state as best as it can.Other Things
format
script to package.json to better make use of prettierNote: I have never touched the Chrome Extensions API before so apologies in advance for any oversights. I have not tested for Firefox.