Glench / ExtPay

The JavaScript library for ExtensionPay.com — payments for your browser extensions, no server needed.
https://extensionpay.com
Other
524 stars 66 forks source link

ExtPay's message listener prints console logs #233

Open ba32107 opened 3 months ago

ba32107 commented 3 months ago

Describe the bug This is a minor issue. The message listener in ExtPay prints a log message: https://github.com/Glench/ExtPay/blob/main/ExtPay.dev.js#L310

This message regularly shows up on my service worker's console. It's not a big deal, but it gets a bit annoying, especially when I'm spending a long time debugging something with my own console logs. As a library, ExtPay should not log anything.

To Reproduce Steps to reproduce the behavior:

  1. Include ExtPay in any project
  2. Start the background page
  3. Send a runtime message
  4. Observe the message on the service worker's console

Expected behavior ExtPay prints no logs.

Additional context

In addition, because ExtPay's own events are not prefixed, there is a possibility of event clashes. Example: https://github.com/Glench/ExtPay/blob/main/ExtPay.dev.js#L311 https://github.com/Glench/ExtPay/blob/main/ExtPay.dev.js#L315

Since these event names are pretty generic, someone can easily pick the same ones for their own events, making it possible that ExtPay picks up unintended events.