Open englehardt opened 3 years ago
@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.
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 theexpires
andmax-age
set-cookie headers. They incorrectly (but understandably) assumed thatexpiry
was simply theexpires
set-cookie header. Had we usedexpirationDate
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 howexpirationDate
is populated within Firefox. I'll save the steps here so we can add a pointer to the documentation:expiry
attribute which prefers max-agecookie-changed
internal event, which is received by the webExtension internals, which subsequently fires an onChanged event, which is received by OpenWPM's instrumentationexpirationDate
property is populated from the internalexpiry
property, and then subsequently theexpirationDate
received by OpenWPM is renamed back toexpiry
in OpenWPM's instrumentation.