Skip to content

Commit 7d30353

Browse files
authored
Update content.js
1 parent cd21faf commit 7d30353

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

content.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1 @@
1-
// content.js
21

3-
// Create a MutationObserver to watch for changes in the player container
4-
const observer = new MutationObserver(mutations => {
5-
mutations.forEach(mutation => {
6-
if (
7-
mutation.attributeName === 'aria-label' &&
8-
mutation.target.getAttribute('aria-label').startsWith('Play')
9-
) {
10-
//console.log('Video started playing');
11-
chrome.runtime.sendMessage({ action: 'videoStarted' });
12-
}
13-
});
14-
});
15-
16-
// Find the player container element
17-
const playerContainer = document.getElementById('player-container');
18-
19-
// Start observing mutations in the player container
20-
observer.observe(playerContainer, { attributes: true });
21-
22-
// Log a message when the content script is loaded
23-
//console.log('Content script loaded');

0 commit comments

Comments
 (0)