mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-21 18:08:46 -04:00
move controller check into initialization
This commit is contained in:
@@ -50,6 +50,10 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
|
||||
function defineVideoController() {
|
||||
tc.videoController = function(target, parent) {
|
||||
if (target.dataset['vscid']) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.video = target;
|
||||
this.parent = target.parentElement || parent;
|
||||
this.document = target.ownerDocument;
|
||||
@@ -244,9 +248,7 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
function checkForVideo(node, parent, added) {
|
||||
if (node.nodeName === 'VIDEO') {
|
||||
if (added) {
|
||||
if (!node.dataset['vscid']) {
|
||||
new tc.videoController(node, parent);
|
||||
}
|
||||
new tc.videoController(node, parent);
|
||||
} else {
|
||||
if (node.classList.contains('vsc-initialized')) {
|
||||
let id = node.dataset['vscid'];
|
||||
|
Reference in New Issue
Block a user