webcompat / webcompat-reporter-extensions

Browser extensions to help report site compatibilty issues.
26 stars 21 forks source link

typeerorr with chrome addon installed #131

Closed miketaylr closed 5 years ago

miketaylr commented 6 years ago
Uncaught TypeError: Cannot read property 'classList' of null
    at content.js:6

str:

  1. install official webcompat reporter addon in chrome
  2. visit webcompat.com and look in console

looks like maybe we need to update that selector (possibly for all addons?)

laghee commented 6 years ago

Yeah, weird, I don't get the same error in nightly, beta, or release, but it's definitely not hiding the download link in firefox (or fennec).

DevEd console:

screenshot 2018-07-10 16 48 36
miketaylr commented 6 years ago

We probably just changed the classname of the link and forgot to update the content script here in the addon.

laghee commented 6 years ago

Yep, looks like it needs to be replaced with body-webcompat.

miketaylr commented 6 years ago

That might make the whole site disappear... maybe js-addon-link?

laghee commented 6 years ago

😂 oops. Yeah, I guess that makes more sense. I must have found is-hidden in there and gotten confused.

Is it better practice to drill down to the smallest possible element (e.g., not using the outer js-addon block)?

miketaylr commented 6 years ago

Is it better practice to drill down to the smallest possible element (e.g., not using the outer js-addon block)?

As long as we hide the link that we need to, it probably doesn't matter that much.

miketaylr commented 5 years ago

screen shot 2018-09-26 at 9 36 59 am

mbuotidem commented 5 years ago

@miketaylr interested in working on this. Any tips?

miketaylr commented 5 years ago

Cool!

I believe the fix will be to update the selector in content.js, to match the the updated class name on webcompat.com:

<a class="nav-link js-addon-link" href="https://chrome.google.com/webstore/detail/webcompatcom-reporter/ffnnhckjcpbbjlmgfjigknkoffakclol" title="Navigate to Chrome webstore">
            <svg class="icon nav-icon" viewBox="0 0 30 30" role="presentation" aria-hidden="true">
                <use xlink:href="#svg-download2"></use>
            </svg>
            <span class="link-text">Download Chrome Add-on</span>
        </a>

To verify it's working locally, with Chrome, install your local addon, go to webcompat.com, and make sure there's no console errors, and also that the "Download Chrome Add-on" link is hidden.

miketaylr commented 5 years ago

Oh wait... I think @laghee did this.

https://github.com/laghee/webcompat-reporter-extensions/commit/50391615c3945f80d759cf319eb9f3d5c2b897a1

miketaylr commented 5 years ago

We really need to get better at closing out fixed issues. 😓

miketaylr commented 5 years ago

(and publish an update to the chrome store)

miketaylr commented 5 years ago

Arf, not fixed yet. There's a PR.