Bug 1604159 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

OK, I now see that the add-on isn't listed in about:debugging when the signed add-on is installed. You need to run some code similar to the snippet in the testing doc in order to see surveys when interventions are ignored. That's because there's only a very small chance (2%) the add-on opens a survey in that case.

Fortunately there's another way to force the surveys. Please run this snippet in the normal browser console. You should see "OK" followed by a JS object that looks like `{ forceSurvey: 1, surveyURL: "http://example.com/" }`. I'll update the testing doc too.

    (async function() {
      const { WebExtensionPolicy } = Cu.getGlobalForObject(
        ChromeUtils.import("resource://gre/modules/Services.jsm", {})
      );
      const { ExtensionStorageIDB } = ChromeUtils.import(
        "resource://gre/modules/ExtensionStorageIDB.jsm",
        {}
      );
      let addonID = "urlbar-interventions@shield.mozilla.org";
      let policy = WebExtensionPolicy.getByID(addonID);
      let storagePrincipal = ExtensionStorageIDB.getStoragePrincipal(
        policy.extension
      );
      let conn = await ExtensionStorageIDB.open(storagePrincipal);
      await conn.set({ surveyURL: "http://example.com/", forceSurvey: 1 });
      console.log(`OK`, await conn.get());
    })();
OK, I now see that the add-on isn't listed in about:debugging when the signed add-on is installed. You need to run some code similar to the snippet in the testing doc in order to see surveys when interventions are ignored. That's because there's only a very small chance (2%) the add-on opens a survey in that case.

Fortunately there's another way to force the surveys. Please run this snippet in the normal browser console. You should see "OK" followed by a JS object that looks like `{ forceSurvey: 1 }`. I'll update the testing doc too.

    (async function() {
      const { WebExtensionPolicy } = Cu.getGlobalForObject(
        ChromeUtils.import("resource://gre/modules/Services.jsm", {})
      );
      const { ExtensionStorageIDB } = ChromeUtils.import(
        "resource://gre/modules/ExtensionStorageIDB.jsm",
        {}
      );
      let addonID = "urlbar-interventions@shield.mozilla.org";
      let policy = WebExtensionPolicy.getByID(addonID);
      let storagePrincipal = ExtensionStorageIDB.getStoragePrincipal(
        policy.extension
      );
      let conn = await ExtensionStorageIDB.open(storagePrincipal);
      await conn.set({ forceSurvey: 1 });
      console.log(`OK`, await conn.get());
    })();
OK, I now see that the add-on isn't listed in about:debugging when the signed add-on is installed. You need to run some code similar to the snippet in the testing doc in order to see surveys when interventions are ignored. That's because there's only a very small chance (2%) the add-on opens a survey in that case.

Fortunately there's another way to force the surveys. Please run this snippet in the normal browser console. You should see "OK" followed by a JS object that looks like `{ forceSurvey: 1 }`. There may be other properties in this object, and that’s OK. The `forceSurvey` property is the important one in this case. I'll update the testing doc too.

    (async function() {
      const { WebExtensionPolicy } = Cu.getGlobalForObject(
        ChromeUtils.import("resource://gre/modules/Services.jsm", {})
      );
      const { ExtensionStorageIDB } = ChromeUtils.import(
        "resource://gre/modules/ExtensionStorageIDB.jsm",
        {}
      );
      let addonID = "urlbar-interventions@shield.mozilla.org";
      let policy = WebExtensionPolicy.getByID(addonID);
      let storagePrincipal = ExtensionStorageIDB.getStoragePrincipal(
        policy.extension
      );
      let conn = await ExtensionStorageIDB.open(storagePrincipal);
      await conn.set({ forceSurvey: 1 });
      console.log(`OK`, await conn.get());
    })();

Back to Bug 1604159 Comment 3