prefiks / u2f4moz

U2F support extension for Firefox
GNU Lesser General Public License v2.1
197 stars 15 forks source link

Content script cleanup/simplification #14

Closed mnoorenberghe closed 8 years ago

mnoorenberghe commented 8 years ago

I got rid of the unnecessary DOM event code and simplified how messages from the chrome code are handled.

prefiks commented 8 years ago

I added those CustomEvents to help with some access problem (i think webpage callbacks that did execute JSON.stringify was producing error about toString not being available or something like that). I think that https://demo.yubico.com/u2f was triggering this. But maybe having closures used as port listeners being created in functions that are exportFunction to page scope will helps with this. Were you able to verify that for example demo.yubico.com/u2f work with that change?

mnoorenberghe commented 8 years ago

OK, that is the page I test with and it works fine in the cases I tested with. I did see an error trying to call toJSON once but I guess that only tries to run in error cases.