Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

Getting values off Active Tab Chrome Extension

$
0
0

I know you can inject scripts into the active tab, such as below

  chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
    chrome.tabs.executeScript( tabs[0].id,
        {code: 'document.getElementById("input").value ="' + youtube_url  + '";'});
    chrome.tabs.executeScript( tabs[0].id,
      {code: "document.getElementById('submit').click();"});
});

But how would you get values of elements in the active tab and store it .Specifically I am trying to check an "a" tag until it switches from its default href value, but I can't seem to get the value.

I am trying to get the value of: document.getElementsByTagName("a")[5].attributes.href.value;

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>