Skip to content

Commit

Permalink
Update content.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijeetbyte authored Nov 7, 2023
1 parent cd21faf commit 7d30353
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions content.js
Original file line number Diff line number Diff line change
@@ -1,23 +1 @@
// content.js

// Create a MutationObserver to watch for changes in the player container
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (
mutation.attributeName === 'aria-label' &&
mutation.target.getAttribute('aria-label').startsWith('Play')
) {
//console.log('Video started playing');
chrome.runtime.sendMessage({ action: 'videoStarted' });
}
});
});

// Find the player container element
const playerContainer = document.getElementById('player-container');

// Start observing mutations in the player container
observer.observe(playerContainer, { attributes: true });

// Log a message when the content script is loaded
//console.log('Content script loaded');

0 comments on commit 7d30353

Please sign in to comment.