My First WebExtension - CookieMaster

I finally completed my first WebExtension today.  It's for controlling what domains may set cookies, in the style of the old CookieMonster add-on for Firefox that didn't get ported to WebExtensions. 

It's available here: with source at

Interestingly, the core functionality (blocking/allowing cookies by domain) was only about 10% of the effort required.  Creating (I hesitate to use the word 'designing' as that implies I know what I'm doing) a usable UI was challenging, and I went through 3-4 iterations before settling on the current design, each taking a moderate amount of coding/re-coding. 

Taking care of cookies set by javascript was also particularly challenging, as the cookie API doesn't let you know which tab made the change.  A truly non-trivial amount of the code is just about trying to keep track of which domains have had web requests from which tabs, so that we can sensibly show the correct information to the user.  This also quickly showed that the larger proportion of the cookies set by advertising networks and the like are set from Javascript, not by headers, something that surprised me in the first instance.

So, if this is your thing, have at it, and feel free to rate it or otherwise let me know what you think.