I have a script that gets the title from a tab and assigns it to a variable. However, I need to also get the meta
desc
and title
properties for use in an input
field.
I am not sure if I can achieve that with this:
chrome.tabs.getSelected(null, function(tab) {
var currentTitle = tab.title;
});
Then I need to get the Meta description, which I don't believe I can get from the tab data.
This is the HTML I am getting the description from:
<meta name="description" content="contentstuffya" />
This is the Javascript I am using to get it outside of the extension:
document.getElementsByName('description')[0].getAttribute('content');
How would I best do this given the data that I have?