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.