glam-lab / degender-the-web

A Chrome extension that replaces all gendered pronouns with "they/them/their."
GNU Affero General Public License v3.0
6 stars 3 forks source link

diff.js throws an error on the Google main page #111

Open beszel opened 5 years ago

beszel commented 5 years ago

Describe the bug The extension page shows an error on the Google search homepage.

Uncaught (in promise) TypeError: Cannot read property 'push' of undefined

To Reproduce Steps to reproduce the behavior:

  1. Go to google.com
  2. Open the extensions page at chrome://extensions
  3. Click on "Errors" button in the Degender the Web section
  4. See error

Expected behavior No error should be thrown.

Additional context The header is also missing; I would have made that the title of the issue if not for #68. I haven't checked if this causes any problems with the popup.

beszel commented 5 years ago

It's possible this issue isn't present on master; Something may have gotten mixed up when switching to a version of the extension before the ID was made constant. I'll have to see about that.

ProfJanetDavis commented 5 years ago

Good catch. This bug is still present after merging PR #109, so we'll need to figure it out.

ProfJanetDavis commented 5 years ago

This seems to be symptomatic of a deeper issue. I was able to avert the bug in a way that doesn't make a whole lot of sense to me.

https://github.com/glam-lab/degender-the-web/blob/6d6cadc581ef70e1025fdae1bfef462125f78086/src/diff.js#L87-L90

https://github.com/glam-lab/degender-the-web/blob/6d6cadc581ef70e1025fdae1bfef462125f78086/src/diff.js#L94-L97

However, after making this change, the popup reports that gender pronouns have been changed on google.com, while in fact no changes are visible.

I need to step back and think about why diff.js is running on this page and what assumptions I'm making about page structure that might not be valid here.