File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -508,14 +508,20 @@ chrome.tabs.onRemoved.addListener(function(tabID) {
508508 delete openedVideos [ tabID ] ;
509509 localStorage . setItem ( 'opened' , JSON . stringify ( openedVideos ) ) ;
510510 }
511+ for ( let tabs of pausedTabs ) {
512+ let i = tabs . indexOf ( tabID ) ;
513+ if ( i > - 1 ) {
514+ tabs . splice ( i , 1 ) ;
515+ }
516+ }
511517 if ( pausedTabs [ tabID ] ) {
512518 setTimeout ( function ( ) {
513519 pausedTabs [ tabID ] . forEach ( function ( tabID ) {
514520 // Possible that the tabs that were paused, were closed before
515521 // the new video tab was closed. Check if the tab is still
516522 // around and if it's at the front. Only then play it.
517523 chrome . tabs . get ( tabID , function ( tab ) {
518- if ( ! tab || ! tab . active ) { return ; }
524+ if ( ! tab . active ) { return ; }
519525 chrome . tabs . executeScript ( tabID , { file : 'content/play.js' } ) ;
520526 } ) ;
521527 } ) ;
You can’t perform that action at this time.
0 commit comments