mirror of
https://github.com/SoPat712/videospeed.git
synced 2026-04-23 05:12:37 -04:00
21 lines
507 B
JavaScript
21 lines
507 B
JavaScript
/* Runs via chrome.tabs.executeScript(allFrames) in the same isolated world as inject.js */
|
|
(function () {
|
|
try {
|
|
if (
|
|
typeof getPrimaryVideoElement !== "function" ||
|
|
typeof computeResetButtonLabelForVideo !== "function"
|
|
) {
|
|
return null;
|
|
}
|
|
var v = getPrimaryVideoElement();
|
|
if (!v) return null;
|
|
return {
|
|
speed: v.playbackRate,
|
|
resetLabel: computeResetButtonLabelForVideo(v),
|
|
preferred: !v.paused
|
|
};
|
|
} catch (e) {
|
|
return null;
|
|
}
|
|
})();
|