title: Chrome extension: Clicking notification opens multiple tabs
body: <pre><code>chrome.runtime.onMessage.addListener(function(msg, sender) {
  
      var options = {
          type: "basic",
          title: msg.title,
          message: "Price: " + msg.price + "\nFinished ",
          iconUrl: "icon.png"
      };
  
      chrome.notifications.create(options);
  
      chrome.notifications.onClicked.addListener(function() {
          chrome.tabs.create({url: "https://example.com/" + msg.link + "/a"});
      });
  
  });
  </code></pre>
  
  <p>When I click on a notification for the first time, it opens a new tab. When I click on a notification for the second time, it opens two new tabs and so on. How can I  make the notification only open one tab?</p>
  
  <p>I have taken a look at <a href="https://stackoverflow.com/questions/24313371/chrome-extension-creating-a-new-tab-after-clicking-on-the-notification">Chrome extension: Creating a new tab after clicking on the notification</a> and have tried doing the suggested (which looks like the below), but this then results in nothing happening when the notification is clicked.</p>
  
  <pre><code>chrome.runtime.onMessage.addListener(function(msg, sender) {
  
      var options = {
          type: "basic",
          title: msg.title,
          message: "Price: " + msg.price + "\nFinished ",
          iconUrl: "icon.png"
      };
  
      chrome.notifications.create(options);
  
  });
  
  chrome.notifications.onClicked.addListener(function() {
      chrome.tabs.create({url: "https://example.com/" + msg.link + "/a"});
  });
  </code></pre>