Consider aligning column names with WebExtension documentation
Following the WebExtension instrumentation upgrade we decided to prefer OpenWPM's previous column names as opposed to changing our column names to align with the names of the WebExtension APIs we're monitoring. This leads to us "converting" the representation internally from WebExtension event --> OpenWPM schema (e.g., as we do for cookies). We should consider aligning with the WebExtension API whenever possible since it will allow us to simply link to the MDN documentation for the relevant WebExtension API.
While I've felt this pain a few times, what sparked it most recently was a user asking how the expiry cookies table column relates to the expires and max-age set-cookie headers. They incorrectly (but understandably) assumed that expiry was simply the expires set-cookie header. Had we used expirationDate naming exposed by WebExtension Cookies API this confusion would have been less likely and added one less layer of indirection. I tracked this down myself to figure out how expirationDate is populated within Firefox. I'll save the steps here so we can add a pointer to the documentation:
- Raw max-age and expiry attributes parsed by Firefox when parsing Set-Cookie header into a single
expiryattribute which prefers max-age - Parsed cookie added to Firefox database
- Adding a cookie fires a
cookie-changedinternal event, which is received by the webExtension internals, which subsequently fires an onChanged event, which is received by OpenWPM's instrumentation - Within the onChanged interal event, the cookie's
expirationDateproperty is populated from the internalexpiryproperty, and then subsequently theexpirationDatereceived by OpenWPM is renamed back toexpiryin OpenWPM's instrumentation.
@vringar wdyt?
I'm in favour of aligning with the official and publicly documented schema instead of the Firefox internal one. We should make sure that we are aligned with these names by just using the types provided by the WebExtension typescript bindings and not defining our own anywhere.