add logic and check for init-once

closes #230, kudos to @xftroxgpx for the detective work and patch.
This commit is contained in:
Ilya Grigorik
2017-07-04 23:38:15 +02:00
parent 18455d521f
commit 5472786b19

View File

@@ -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 {