warren-bank / Android-WebMonkey

No-frills light-weight Android web browser with support for Greasemonkey userscripts.
https://warren-bank.github.io/Android-WebMonkey/index.html
GNU General Public License v2.0
105 stars 24 forks source link

Can you support the GM_cookie API? #16

Open cloudswave opened 1 year ago

cloudswave commented 1 year ago

The API document GM_cookie

warren-bank commented 1 year ago

I probably won't be able to start working on it for a few days, but from a technical standpoint.. it seems doable. I'll let you know when I have a version available.

warren-bank commented 1 year ago

quick update..

I've been struggling with how encoding/decoding should be handled:

  1. transparently
    • which could potentially mess up the value
  2. manually
    • which could potentially include reserved characters and be truncated

I think I'll release (shortly) another version, which:

one technical note:

warren-bank commented 1 year ago

update..

4.0.2 does exactly what I previously described.. which seems like the best compromise


btw, there are 2 relevant test userscripts.. that I used to validate behavior:

  1. GM_cookie.*
    • methods accept a callback parameter
  2. GM.cookie.*
    • methods return a Promise

PPS: they use console.log statements..