diff options
author | Ajay Ramachandran <[email protected]> | 2019-08-26 14:30:55 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2019-08-26 14:30:55 -0400 |
commit | 5bbfcf742d248a28d39808797db2624596712aa7 (patch) | |
tree | 68ff8b90562f3f1aac08aecb72a21c016f166650 | |
parent | aaf79fda0d21068716d2b5af00fada2675d4ee65 (diff) | |
download | SponsorBlock-5bbfcf742d248a28d39808797db2624596712aa7.tar.gz SponsorBlock-5bbfcf742d248a28d39808797db2624596712aa7.zip |
Fixed preview bar bar loading too early
-rw-r--r-- | content.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -238,8 +238,10 @@ function videoIDChange(id) { //setup the preview bar if (previewBar == null) { //create it - let progressBar = document.getElementsByClassName("ytp-progress-bar-container")[0] || document.getElementsByClassName("no-model cue-range-markers")[0]; - previewBar = new PreviewBar(progressBar); + wait(getControls).then(result => { + let progressBar = document.getElementsByClassName("ytp-progress-bar-container")[0] || document.getElementsByClassName("no-model cue-range-markers")[0]; + previewBar = new PreviewBar(progressBar); + }); } //warn them if they had unsubmitted times @@ -271,7 +273,7 @@ function videoIDChange(id) { sponsorsLookup(id); //make sure everything is properly added - updateVisibilityOfPlayerControlsButton(true); + updateVisibilityOfPlayerControlsButton(); //reset sponsor times submitting sponsorTimesSubmitting = []; |