Skip to content

Commit

Permalink
simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng authored Nov 23, 2018
1 parent 324cbb9 commit b2b3bca
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions bilibili_adjustPlayer_old.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,22 +351,7 @@
childList: true
});
}
} else if (matchURL.isWatchlater()) {
var observer = new MutationObserver(function(records) {
records.map(function(record) {
var targetNode = record.target.getAttribute("class");
if (targetNode.search("video-state-pause") !== -1) {
nextPlist();
observer.disconnect();
}
});
});
observer.observe(document.querySelector('#bofqi .bilibili-player-area'), {
attributes: true,
attributeFilter: ['class'],
childList: true
});
} else if (matchURL.isOldBangumi() || matchURL.isNewBangumi()) {
} else if (matchURL.isOldBangumi() || matchURL.isNewBangumi()) {
if (isBangumi('.bilibili-player-bangumipay-panel') === null) {
video.addEventListener('ended', function() {
nextPlist();
Expand All @@ -387,6 +372,10 @@
childList: true
});
}
} else if (matchURL.isWatchlater()) {
video.addEventListener('ended', function() {
nextPlist();
}, false);
}
} catch (e) {
console.log('autoNextPlist:' + e);
Expand Down

0 comments on commit b2b3bca

Please sign in to comment.