biancadanforth / tracking-protection-shield-study

A Shield study to determine the optimal messaging, if any, for Tracking Protection in Firefox.
0 stars 3 forks source link

"URL is not a constructor" error when study ends while page loading #51

Closed biancadanforth closed 6 years ago

biancadanforth commented 6 years ago

Even though the addon has executed its shutdown method (including feature.uninit which removes the WebRequest.onBeforeRequest listener, and unloading Feature.jsm), if I end the study via the intro panel while a page is still loading, I get a bunch of "URL is not a constructor" errors in the browser console from Feature.jsm.

screen shot 2018-01-21 at 7 51 39 pm

The line the error references is from the onBeforeRequest event handler method, which shouldn't be firing anymore.

const host = new URL(details.originUrl).host;

When I click the link to Feature.jsm in the browser console, it takes me to a blank page, since the module is unloaded.

What on earth is going on? @rhelmer , any ideas?

biancadanforth commented 6 years ago

@gregglind Can you take a look at this one?

gregglind commented 6 years ago
      if (!currentURI) {
        return {};
      }

      // the URL for the entity making the request
      if (!details.originUrl) {
        return {};
      }

      if (currentURI.scheme !== "http" && currentURI.scheme !== "https") {
        return {};
      }

Claim: