mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-21 18:08:46 -04:00
add logic and check for init-once
closes #230, kudos to @xftroxgpx for the detective work and patch.
This commit is contained in:
@@ -195,6 +195,13 @@ chrome.extension.sendMessage({}, function(response) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function initializeNow(document) {
|
function initializeNow(document) {
|
||||||
|
// in theory, this should only run once, in practice..
|
||||||
|
// that's not guaranteed, hence we enforce own init-once.
|
||||||
|
if (document.body.classList.contains('vsc-initialized')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
document.body.classList.add('vsc-initialized');
|
||||||
|
|
||||||
if (document === window.document) {
|
if (document === window.document) {
|
||||||
defineVideoController();
|
defineVideoController();
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user