I am writing a Google Chrome extension. I don't know JavaScript and I'm trying to identify whether the "dislike" button is active (means blue, because it has been clicked by me at some point and therefore marks that I don't like the video) element in a YouTube video page.
I tried various ways but I am hopeless. A few of my attempts:
//result = document.querySelector("path[d]");
//var something = document.querySelector('[d=M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v1.91l.01.01L1 14c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z" class="style-scope yt-icon]');
Can somebody help me? Interestingly I only find this attribute when inspecting the page, if I look at the page source it't not even present in the page (I have no web development knowledge, I suspect it's some dynamic trick?).
Edit: I use the following at the beginning of my chrome extension background script to make sure the page is loaded:
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
if (changeInfo.status == 'complete') {
if (tab.url.indexOf("youtube.com") != -1) {