So I am developing a chrome extension. I am trying to get the Youtube video current playing time
I am aware that there are many similar questions asked in other posts, but none of their code works for me
My code is like this, I have to inject my code to the content script first
chrome.tab.query({highlighted: true}, tabs => {
tab = tabs[0]
chrome.tabs.executeScript(tab.id, {code: "temp =
document.getElementById('movie_player');
alert(temp); alert(temp.getCurrentTime());"}, respond => {});
}
So when I run this, I will get an alert saying [object HTMLDivElement]. but won't get anything from temp.getCurrentTime().