Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chrome] TypeError: Cannot read properties of undefined (reading 'length') when Site access is set to "On click" #486

Open
Oxalin opened this issue Apr 1, 2024 · 5 comments

Comments

@Oxalin
Copy link
Contributor

Oxalin commented Apr 1, 2024

Extension v3.1.0

Under Chrome, go under Menu > Add-ons and themes > Extensions > Buttercup > Manage
There, under "Site access", you will find "Allow this extension to read and change all your data on websites you visit:".
Set it to "On click"

For the Buttercup extension to be accessible, you will need to click on the icon in your Extension bar to let it read and change data so it can integrate itself next to username and password fields and be accessible.

Now, if you click on the extension icon to access its menu, it will fail and throw:
Unexpected Application Error!
Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
image

After changing the "Site access" option back to "On all sites", the extension will stop throwing error and it will work as expected.

This feature is not available under Firefox, so it is not reproducible.
Default config will prevent this error from happening (set to "On all sites"), so it may not be a high priority.
It may affect other Chromium derivatives.

@Oxalin
Copy link
Contributor Author

Oxalin commented Apr 1, 2024

Full console log
image

@perry-mitchell
Copy link
Member

Didn't realise such a chrome feature existed. I'd be surprised if it's a large amount of users that have this enabled, but that's just a guess.

I wouldn't want supporting this to complicate the extension code too much. If it's a benign change then ok. Depends on what needs to be added to the following areas:

  • Background tab handling
  • Tab script
  • popup menu for current tab

As of now this is an unsupported feature, until further notice.

@Oxalin
Copy link
Contributor Author

Oxalin commented Apr 1, 2024

No problem. If I'm able to give more insight, I'll do it.

I began using this feature after discovering Buttercup was interfering with a website used here in Quebec during the pandemic. It is the only website that I've ever experienced trouble with Buttercup. I've kept it that way ever since.

@doublemarket
Copy link

This is not a request for the support but just a report to let you know there's another user who encountered the same issue. I spent some time to investigate the error until I came up with this GitHub issue as I've set "On click" enabled. Same with @Oxalin I enabled it to prevent unexpected behavior of the extension on some sites and to minimize security risks in general.

@perry-mitchell
Copy link
Member

Happy to have someone contribute a PR for this, so long as it's as clean as possible and tested in every browser we support currently (chrome/edge/firefox).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants