sereneblue / chameleon

WebExtension port of Random Agent Spoofer
https://sereneblue.github.io/chameleon
GNU General Public License v3.0
501 stars 53 forks source link

Uncaught exceptions. #580

Open diegocr opened 5 months ago

diegocr commented 5 months ago

Hello,

I would like to bring to your attention that this extension is randomly causing uncaught exceptions to some of our users, according to the error-reporting built into our website.

I hereby request you do add on due measures so that any unexpected failure of the like is handled gracefully without breaking the underlying logic for the browser's APIs you may be monkey-patching.

Some of these exceptions are:

TypeError: null is not a non-null object
Line: 838
Stack:
 inject/spoofContext.open@..:838:20
...

TypeError: can't access dead object
Line: 459
Stack:
 inject/</spoofContext.Element.prototype.getClientRects@..:459:28
...

TypeError: e is undefined
Line: 203
Stack:
 inject/</</spoofContext.Element.prototype[method]@..:203:21
...

Thank you in advance.

sereneblue commented 5 months ago

Hi @diegocr,

Thanks for reporting this. Can you provide a link to the site/page these errors are appearing on?

diegocr commented 5 months ago

Hi @sereneblue, if you do intent to go to the website to try to reproduce it, i guess you may won't have much luck doing that, since we do receive millions of visits per day and these exceptions were only reported a handful of times over the past two weeks, so only a niche of users facing it.

While completely spoofed by the nature of this extension, i can provide the following stats:

Filtered "non-null object" with 18 hits over 14 unique browsers from 2024-03-15T14:34 to 2024-03-29T15:51

    browser: Firefox (72%, 13), Chrome (11%, 2), Edgium (6%, 1)
   platform: Windows (72%, 13), Linux (22%, 4)
    product: Firefox on Windows (56%, 10), Firefox on Linux (17%, 3), Chrome on Windows (11%, 2)
     engine: Gecko 123 (28%, 5), Gecko 115 (22%, 4), Gecko 102 (11%, 2), Gecko 124 (11%, 2)
    country: FR (17%, 3), US (11%, 2), GB (11%, 2), UA (11%, 2)

That happens while invoking a mere open() call, i.e.

window.open('https://some-external.url', '_blank', 'noopener,noreferrer');

You know there may be some factors that could cause this to misbehave beyond your extension, other extensions could be in play here or even some of these APIs made immutable, thus why i was saying to add on due measures to expect this could happen so that the code in your extension doesn't break anything underneath.

sereneblue commented 5 months ago

I see, thanks for providing some more details. I'll review the implementations when I have some available time to resolve this issue. I do think Chameleon is likely the cause. I appreciate you reaching out!