PiedPiPer.safariextension
PiedPiPer.safariextension copied to clipboard
Plex no longer works
Recently Plex updated their web player and this extension no longer works:


FWIW until this extension updates, I wrote one that just makes right-clicking on the video (full-screen or mini-player) expose the PiP controls: http://drp.joe.sh/pb-uWXRTJqlfO.png
https://twitter.com/josephschmitt/status/904044229613297664
@josephschmitt: Thanks, but I will not install an arbitrary extension offered by some person without inspecting the source code first.
Just in case anyone is wondering the same, here's the content of plexPip.js
inside the extension as of today:
(function (plex) {
let timeout;
plex && plex.addEventListener('contextmenu', (e) => {
const button = plex.querySelector('[class*="AudioVideoFullPlayer-isVideo"]');
const miniPlayer = plex.querySelector('[class*="MiniPlayerContainer-miniPlayer"]')
const wasVideoBlocked = (button && button.contains(e.target) || (miniPlayer && miniPlayer.contains(e.target)));
toggleBlock(wasVideoBlocked, button, miniPlayer);
});
function toggleBlock(disableBlock, button, miniPlayer) {
if (button) {
button.style.pointerEvents = disableBlock ? 'none' : '';
}
if (miniPlayer) {
miniPlayer.style.pointerEvents = disableBlock ? 'none' : '';
}
// Reset after a few secs
if (disableBlock) {
clearTimeout(timeout);
timeout = setTimeout(() => toggleBlock(false, button, miniPlayer), 3000)
}
}
})(document.querySelector('#plex'));
Quite innocent. So thanks again!
@herrbischoff be my guest, source code was linked in the tweet https://gist.github.com/josephschmitt/f0a3ab7057b0632dfb4b2bc233769077