title: Chrome extension how to use lists/arrays?
body: <p>I want to develop a small extension that is supposed to let the user add URLs and whenever the browser goes to one of the added URLs, it will do something.</p>
  <p>Now I have looked at the official getting started guide so I got some of the basics down. However, I don't understand how I can store a list and update it and check it. Under conditions, I would like to iterate my list and then check if any of the values there actually match. Something like this:</p>
  <p><strong>background.js</strong></p>
  <pre class="lang-js prettyprint-override"><code>// Copyright 2018 The Chromium Authors. All rights reserved.
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
  'use strict';
          
  chrome.runtime.onInstalled.addListener(function() {
    var testArray=[&quot;Installed1&quot;, &quot;Installed2&quot;];
          
    chrome.storage.sync.set( { list:testArray }, function() {
      console.log(&quot;added to list&quot;);
    });
          
    chrome.storage.sync.get('list', function(data) {
  
      changeColor.style.backgroundColor = data.color;
      changeColor.setAttribute('value', data.color);
                
      chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
  
        chrome.declarativeContent.onPageChanged.addRules([{
          conditions: [new chrome.declarativeContent.PageStateMatcher({
            pageUrl: {hostEquals: 'developer.chrome.com'},
          })],//Check the list values here?
          actions: [new chrome.declarativeContent.ShowPageAction()]
        }]);
  
      });
  
    });
                    
  });
  </code></pre>