Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic decoding of URLencoded cookies #235

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

npicca
Copy link

@npicca npicca commented Oct 24, 2018

First of all thank you for developing and maintaining this amazing extension :)
However, one thing that always bothered me is the fact that the cookies are displayed "as is", with most special characters URLencoded. This is expecially painful if a JSON is stored in a cookie, making it hard to read.
I tried to fix it by adding an option (disabled by default) which allowed to automatically URL-decode the cookie name and value.
I'm aware of #19 , but I wasn't able to replicate the issue, even with URL-decoding turned on.

I also added the locale strings for it and en, and the other languages should fallback to en.

Let me know if this is acceptable, or if it needs more work :)

@fcapano
Copy link
Member

fcapano commented Nov 27, 2018

Hi @npicca, thanks for the work and the kind words!
Do you have an example website where I can test this change?

@npicca
Copy link
Author

npicca commented Nov 27, 2018

Sure!
I've set up a simple test website, which sets a JSON as a cookie (urlencoded because it contains special values). This is done via javascript because i used a python simpleHTTPserver, but it also applies to cookies set via an header.
If you want to try in the real world, github has a cookie tz, in the format Continent/City (eg Europe/Rome). The slash is usually displayed as %2F, but with my patch it's decoded (aiding readibility).
Let me know if you want to test some more examples :)

@fcapano
Copy link
Member

fcapano commented Nov 28, 2018

I understand the change now. Unfortunately the change as is is not good because it doesn't just display the values in a friendly format, it also changes the format of the stored cookie.

For instance, your test page creates a cookie with value:
"%7B%22weird_cookie-val%22%3A%22With%3Dspecial%2FCHARS%22%7D".
With your changes enabled, if I open the EditThisCookie popup and click save, the cookie's new value will be:
"{"weird_cookie-val":"With=special/CHARS"}"
which is not what I was expecting.

This is a tricky issue because a cookie might have both url encoded characters and non-url encoded ones. For example this is a valid cookie value: "%7B{". How would you go, then, pretty printing it in the UI but storing the right value when you save it?

YoeriW added a commit to YoeriW/Edit-This-Cookie that referenced this pull request Dec 15, 2024
…nifest V3

chore: update and support for chrome manifest version 3
ETCExtensions#373 opened on Aug 31 by cldevdad
 2
All the 10 other PR since 2018 + one fix from me
ETCExtensions#344 opened on Dec 19, 2022 by cw2k
 1
Make links https
ETCExtensions#337 opened on Jul 6, 2022 by AndrewLane
Fixed adding a cookie using a form
ETCExtensions#333 opened on Apr 10, 2022 by Qliane
update no locales
ETCExtensions#297 opened on Oct 4, 2020 by steinhaug
add cookie paste option: toCurrentTabCookieUrl
ETCExtensions#292 opened on Aug 12, 2020 by Akimyou
Update cookie_helpers.js
ETCExtensions#286 opened on Jul 22, 2020 by SnailDev
 1
Fix new Chrome cookie policy.
ETCExtensions#278 opened on Mar 29, 2020 by dalejung
Fix imports like ".domain.com" when there's no URL
ETCExtensions#275 opened on Mar 21, 2020 by geekley
 2
export for map
ETCExtensions#267 opened on Nov 30, 2019 by GongShengyue
Fix: Skip the www removal when the host does not start with www
ETCExtensions#254 opened on Aug 19, 2019 by sebui
Automatic decoding of URLencoded cookies
ETCExtensions#235 opened on Oct 24, 2018 by npicca
YoeriW added a commit to YoeriW/Edit-This-Cookie that referenced this pull request Dec 15, 2024
…nifest V3 + replaced deprecated chrome function

chore: update and support for chrome manifest version 3
ETCExtensions#373 opened on Aug 31 by cldevdad
 2
All the 10 other PR since 2018 + one fix from me
ETCExtensions#344 opened on Dec 19, 2022 by cw2k
 1
Make links https
ETCExtensions#337 opened on Jul 6, 2022 by AndrewLane
Fixed adding a cookie using a form
ETCExtensions#333 opened on Apr 10, 2022 by Qliane
update no locales
ETCExtensions#297 opened on Oct 4, 2020 by steinhaug
add cookie paste option: toCurrentTabCookieUrl
ETCExtensions#292 opened on Aug 12, 2020 by Akimyou
Update cookie_helpers.js
ETCExtensions#286 opened on Jul 22, 2020 by SnailDev
 1
Fix new Chrome cookie policy.
ETCExtensions#278 opened on Mar 29, 2020 by dalejung
Fix imports like ".domain.com" when there's no URL
ETCExtensions#275 opened on Mar 21, 2020 by geekley
 2
export for map
ETCExtensions#267 opened on Nov 30, 2019 by GongShengyue
Fix: Skip the www removal when the host does not start with www
ETCExtensions#254 opened on Aug 19, 2019 by sebui
Automatic decoding of URLencoded cookies
ETCExtensions#235 opened on Oct 24, 2018 by npicca
YoeriW added a commit to YoeriW/Edit-This-Cookie that referenced this pull request Dec 15, 2024
…nifest V3 + replaced deprecated chrome function

chore: update and support for chrome manifest version 3
ETCExtensions#373 opened on Aug 31 by cldevdad
 2
All the 10 other PR since 2018 + one fix from me
ETCExtensions#344 opened on Dec 19, 2022 by cw2k
 1
Make links https
ETCExtensions#337 opened on Jul 6, 2022 by AndrewLane
Fixed adding a cookie using a form
ETCExtensions#333 opened on Apr 10, 2022 by Qliane
update no locales
ETCExtensions#297 opened on Oct 4, 2020 by steinhaug
add cookie paste option: toCurrentTabCookieUrl
ETCExtensions#292 opened on Aug 12, 2020 by Akimyou
Update cookie_helpers.js
ETCExtensions#286 opened on Jul 22, 2020 by SnailDev
 1
Fix new Chrome cookie policy.
ETCExtensions#278 opened on Mar 29, 2020 by dalejung
Fix imports like ".domain.com" when there's no URL
ETCExtensions#275 opened on Mar 21, 2020 by geekley
 2
export for map
ETCExtensions#267 opened on Nov 30, 2019 by GongShengyue
Fix: Skip the www removal when the host does not start with www
ETCExtensions#254 opened on Aug 19, 2019 by sebui
Automatic decoding of URLencoded cookies
ETCExtensions#235 opened on Oct 24, 2018 by npicca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants