webcompat / webcompat-reporter-extensions

Browser extensions to help report site compatibilty issues.
26 stars 21 forks source link

Update addon to send data via postMessage rather than rely on GET params #138

Closed miketaylr closed 4 years ago

miketaylr commented 5 years ago

This might not even be possible with existing web extension APIs... but Tom has some advice here:

https://github.com/mozilla/webcompat-team-okrs/issues/34#issuecomment-429558122

miketaylr commented 5 years ago

Here's a variation of what Tom is describing: https://stackoverflow.com/a/23687543/66348

ksy36 commented 4 years ago

As we're adding postMessage data support on the webcompat.com side not only for screenshots, but for the rest of the metadata in https://github.com/webcompat/webcompat.com/issues/2985 , lets send all data via postMessage to unify things.

So here https://github.com/webcompat/webcompat-reporter-extensions/blob/master/shared/base.js#L34 we'd need to send a postMessage with the following structure

        const data = {
          screenshot: blob,
          message: message
        };

where message should be a stringified object with url, src, utm_source and utm_campaign properties and screenshot should be a blob instead of base64 string. This will also allow us to drop base64 support on webcompat.com side as described here https://github.com/webcompat/webcompat.com/issues/1252