Skip to content

Commit

Permalink
Update 473972.user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfung1031 committed Jan 17, 2024
1 parent b3a0d47 commit e119316
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions 473972.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @name YouTube JS Engine Tamer
// @namespace UserScripts
// @match https://www.youtube.com/*
// @version 0.10.4
// @version 0.10.5
// @license MIT
// @author CY Fung
// @icon https://github.com/cyfung1031/userscript-supports/raw/main/icons/yt-engine.png
Expand Down Expand Up @@ -3722,9 +3722,12 @@
a.addEventListener('timeupdate', (evt) => {
const a = evt.target;
console.log(`video element added to dom | ontimeupdate`, mWeakRef(a), a.readyState, a.networkState, a.currentTime);
if (a.duration < 2.01 && a.duration > 1.99 && a.currentSrc === src && a.autoplay === false) {
URL.revokeObjectURL(src);
console.log(`video element added to dom | revokeObjectURL`, mWeakRef(a), a.readyState, a.networkState, a.currentTime);
if (a.duration < 2.01 && a.duration > 1.99 && a.currentSrc === src) {
try {
URL.revokeObjectURL(src);
} finally {
console.log(`video element added to dom | revokeObjectURL`, mWeakRef(a), a.readyState, a.networkState, a.currentTime);
}
}
}, { once: true, passive: true, capture: false });
}
Expand Down

0 comments on commit e119316

Please sign in to comment.