title: How to get document from current tab in background.js
body: <p>I'm making a chrome extension that shows notifications, when the user clicks the button on the notification it opens an html file in a new tab through background.js that I need to modify after an api call, but I can't find a way to access that page through my background.js.</p>
  
  <p>manifest.json Permissions
  <code>"permissions": ["http://*/*", "https://*/*","notifications", "webNavigation", "storage", "tabs","activeTab", "background" ]</code></p>
  
  <p>part of background.js</p>
  
  <pre><code>chrome.notifications.onButtonClicked.addListener(function() {
    chrome.tabs.create({'url': 'index.html'}, (tab) =&gt; {
      chrome.tabs.executeScript(tab,add_new_card());
    });
  });
  
  
  function add_new_card(){
    var elm= document.getElementById("cards");
    console.log(document);
    let new_card = '&lt;div class="col-5 col-md-3 col-lg-2 p-0 mr-2 col"&gt; ' +
                       '&lt;div class="card"&gt; ' +
                          '&lt;a class="text-center" href=""&gt; ' +
                          '&lt;div class=" f-16 text-dark mt-4 card-title"&gt; '+
                          '&lt;strong class="text-capitalize"&gt;NEW CARD&lt;/strong&gt; '+
                        '&lt;/div&gt; &lt;/a&gt;  &lt;/div&gt; &lt;/div&gt; ';
    elm.append(new_card);
  }
  </code></pre>
  
  <p>I've tried a lot of things but I always get null from document.getElementById("cards").</p>