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