Commit 80e565db authored by Andrea Giammarchi's avatar Andrea Giammarchi Committed by Winsley
Browse files

Issue 7439 - Custom filter table: trigger an error on wrong header

parent dc1aa40e
Loading
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -128,9 +128,6 @@
  ]);

  if (!("tabs" in browser))
<<<<<<< HEAD
    browser.tabs = new Map([[0, {url: "http://example.com", id: 0, active: true, lastFocusedWindow: true}]]);
=======
    browser.tabs = {};

  browser.tabs.captureVisibleTab = (tabId, options) =>
@@ -176,7 +173,6 @@
    tabs.delete(tabId);
    return Promise.resolve();
  };
>>>>>>> Issue 7144 - Fixed: Issue reporter mock was broken

  browser.tabs.update = (tabId, options) =>
  {
@@ -188,14 +184,6 @@
    return Promise.resolve();
  };

<<<<<<< HEAD
  browser.tabs.query = (...args) =>
  {
    const result = Map.prototype.get.apply(browser.tabs, [0]);
    return (result ? Promise.resolve([result]) :
      Promise.reject(new Error("Tab cannot be found")));
  };
=======
  class MockXmlHttpRequest extends XMLHttpRequest
  {
    get responseText()
@@ -251,5 +239,4 @@
    }
  }
  window.XMLHttpRequest = MockXmlHttpRequest;
>>>>>>> Issue 7144 - Fixed: Issue reporter mock was broken
}());
+0 −46
Original line number Diff line number Diff line
@@ -950,11 +950,7 @@ function onDOMLoaded()
  });
  for (const key of customize)
  {
<<<<<<< HEAD
    getPref(key).then(value =>
=======
    getPref(key).then((value) =>
>>>>>>> Issue 7345 - Use the extension Promise API in release-2018-5
    {
      onPrefMessage(key, value, true);
    });
@@ -1132,11 +1128,7 @@ function setPrivacyConflict()
  const acceptableAdsForm = $("#acceptable-ads");
  if (hasPrivacyConflict())
  {
<<<<<<< HEAD
    getPref("ui_warn_tracking").then(showTrackingWarning =>
=======
    getPref("ui_warn_tracking").then((showTrackingWarning) =>
>>>>>>> Issue 7345 - Use the extension Promise API in release-2018-5
    {
      acceptableAdsForm.classList.toggle("show-warning", showTrackingWarning);
    });
@@ -1168,11 +1160,7 @@ function populateLists()
    browser.runtime.sendMessage({
      type: "subscriptions.get",
      special: true
<<<<<<< HEAD
    }).then(subscriptions =>
=======
    }).then((subscriptions) =>
>>>>>>> Issue 7345 - Use the extension Promise API in release-2018-5
    {
      const customFilterPromises = subscriptions.map(getSubscriptionFilters);
      Promise.all(customFilterPromises).then((filters) =>
@@ -1181,39 +1169,6 @@ function populateLists()
        isCustomFiltersLoaded = true;
      }).then(done);
    });
<<<<<<< HEAD

    browser.runtime.sendMessage({
      type: "prefs.get",
      key: "subscriptions_exceptionsurl"
    }).then(url =>
    {
      acceptableAdsUrl = url;

      return browser.runtime.sendMessage({
        type: "prefs.get",
        key: "subscriptions_exceptionsurl_privacy"
      });
    }).then(urlPrivacy =>
    {
      acceptableAdsPrivacyUrl = urlPrivacy;

      return getPref("additional_subscriptions");
    }).then(subscriptionUrls =>
    {
      additionalSubscriptions = subscriptionUrls;

      // Load user subscriptions
      return browser.runtime.sendMessage({
        type: "subscriptions.get",
        downloadable: true
      });
    }).then(subscriptions =>
    {
      for (const subscription of subscriptions)
        onSubscriptionMessage("added", subscription);

=======

    Promise.all([
      browser.runtime.sendMessage({
@@ -1239,7 +1194,6 @@ function populateLists()
      for (const subscription of subscriptions)
        onSubscriptionMessage("added", subscription);

>>>>>>> Issue 7345 - Use the extension Promise API in release-2018-5
      setAcceptableAds();
      done();
    });
+1 −3
Original line number Diff line number Diff line
@@ -259,9 +259,7 @@ function addFilter(data)

function dispatch(type, detail)
{
  // do not bother at all if there are no filters
  // initialize the table on "filter:add" anyway
  if (type === "filter:add" || this.filters.length)
  if (/^filter:(?:add|error)$/.test(type) || this.filters.length)
    this.dispatchEvent(new CustomEvent(type, {detail}));
}

+0 −10
Original line number Diff line number Diff line
@@ -26,18 +26,8 @@ activeTab
  {
    return browser.runtime.sendMessage({
      type: "notifications.get",
<<<<<<< HEAD
      displayMethod: "popup"
    }).then(notification =>
    {
      if (notification)
        window.dispatchEvent(
          new CustomEvent("extension:notification", {detail: notification})
        );
=======
      displayMethod: "popup",
      url: tab.url
>>>>>>> Issue 7110 - Only show icon popup notification for pages that match URL filters
    });
  })
  .then((notification) =>