datenanfragen / website

The Datenanfragen.de website including the request PDF generator and company information database
https://www.datenanfragen.de
MIT License
88 stars 126 forks source link

JS error (undefined) w/ Bitwarden & Dark Reader extensions #1128

Closed Asudox closed 4 months ago

Asudox commented 5 months ago

As soon as I tried to edit the email field while creating a request, an error occurred.

Debug information:

{
    "type": "unhandledrejection",
    "error": {
        "message": "Permission denied to access property \"then\"",
        "name": "Error",
        "stack": ""
    },
    "defaultPrevented": false,
    "eventPhase": 2,
    "isTrusted": true,
    "returnValue": true,
    "code_version": "1.0.0",
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0",
    "url": {
        "href": "https://www.datarequests.org/generator#!request_type=erasure",
        "origin": "https://www.datarequests.org",
        "protocol": "https:",
        "host": "www.datarequests.org",
        "hostname": "www.datarequests.org",
        "port": "",
        "pathname": "/generator",
        "search": "",
        "hash": "#!request_type=erasure"
    }
}

Debug information:

{
    "type": "unhandledrejection",
    "error": {
        "message": "Permission denied to access property \"then\"",
        "name": "Error",
        "stack": ""
    },
    "defaultPrevented": false,
    "eventPhase": 2,
    "isTrusted": true,
    "returnValue": true,
    "code_version": "1.0.0",
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0",
    "url": {
        "href": "https://www.datarequests.org/generator#!request_type=erasure",
        "origin": "https://www.datarequests.org",
        "protocol": "https:",
        "host": "www.datarequests.org",
        "hostname": "www.datarequests.org",
        "port": "",
        "pathname": "/generator",
        "search": "",
        "hash": "#!request_type=erasure"
    }
}
baltpeter commented 5 months ago

Thanks for the report, @Asudox!

I haven't been able to reproduce the problem on my end and unfortunately the debug information is missing a stack trace, which makes it very hard to debug.

According to MDN, the rather unusual error message usually occurs in the context of a site being loaded in an iframe (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Property_access_denied). However, that seems unlikely to be the case here, since we set the x-frame-options: DENY header, which should prevent that.

I also found a reference to this happening in an addon (https://stackoverflow.com/questions/69518796/firefox-extension-share-async-function-with-return-gives-error-permission-de). That seems more plausible: Maybe you have a password manager or similar addon installed that wants to hook our email input somehow but fails due to our rather strict CSP? That could also explain the empty stack trace.

Asudox commented 5 months ago

Thanks for the report, @Asudox!

I haven't been able to reproduce the problem on my end and unfortunately the debug information is missing a stack trace, which makes it very hard to debug.

According to MDN, the rather unusual error message usually occurs in the context of a site being loaded in an iframe (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Property_access_denied). However, that seems unlikely to be the case here, since we set the x-frame-options: DENY header, which should prevent that.

I also found a reference to this happening in an addon (https://stackoverflow.com/questions/69518796/firefox-extension-share-async-function-with-return-gives-error-permission-de). That seems more plausible: Maybe you have a password manager or similar addon installed that wants to hook our email input somehow but fails due to our rather strict CSP? That could also explain the empty stack trace.

I do have a password manager: Bitwarden. I'll try it with the password manager disabled and let you know.

baltpeter commented 5 months ago

I just tested Bitwarden in a clean browser profile and it doesn't seem to be the culprit:

Screencast from 2024-01-16 12-46-59.webm

But maybe you have different settings, so it would still be good if you test this on your end, thanks.

Asudox commented 5 months ago

I just tested Bitwarden in a clean browser profile and it doesn't seem to be the culprit: Screencast.from.2024-01-16.12-46-59.webm

But maybe you have different settings, so it would still be good if you test this on your end, thanks.

After trying it with Bitwarden disabled and enabled. It seems like it alone isn't the one causing the issues. Dark Reader seems to be the one causing the issues with Bitwarden. It specifically causes this error when Dark Reader with Bitwarden's autofill menu is enabled. Upon using the Bitwarden's autofill menu without Dark Reader, everything appears to be fine (both with the autofill menu enabled or disabled) So it has something to do with Dark Reader.

christian-weiss commented 5 months ago

Dark Reader seems to be the trigger for this problem. On my Firefox (without Bitwarden; on Ubuntu) i get an JavaScript error, when Dark Reader is enabled. I do not get this error if Dark Reader is disabled. Error happens on Homepage of datarequests.org.

Debug information:

{
    "message": "TypeError: WeakMap key undefined must be an object or an unregistered symbol",
    "type": "error",
    "colno": 36,
    "filename": "https://www.datarequests.org/",
    "lineno": 529,
    "error": {
        "message": "WeakMap key undefined must be an object or an unregistered symbol",
        "name": "TypeError",
        "stack": "executeCommands@https://www.datarequests.org/:529:36\ncommandsListener@https://www.datarequests.org/:652:32\n"
    },
    "defaultPrevented": false,
    "eventPhase": 2,
    "isTrusted": true,
    "returnValue": true,
    "code_version": "1.0.0",
    "user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0",
    "url": {
        "href": "https://www.datarequests.org/",
        "origin": "https://www.datarequests.org",
        "protocol": "https:",
        "host": "www.datarequests.org",
        "hostname": "www.datarequests.org",
        "port": "",
        "pathname": "/",
        "search": "",
        "hash": ""
    }
}

Screenshot from 2024-01-17 23-44-23

mal-tee commented 4 months ago

This could be fixed now, see https://github.com/darkreader/darkreader/issues/12169

Does the issue persists?

Asudox commented 4 months ago

This could be fixed now, see https://github.com/darkreader/darkreader/issues/12169

Does the issue persists?

Seems like dark reader devs fixed it. The problem no longer persists.