I wrote a user script that does that!
Available on my GitHub, on Greasy Fork and OpenUserJS, under the MIT license.
What it does
- It checks if it's on a video page (URL contains
/videos/
) and if so:
- It checks every half a second if the popup appeared, and if so - removes it.
- It also cancels the next video from playing automatically.
The code snippet
It's recommended to use one of the links I mentioned above, linking to a .user.js file, since it will allow your user script manager[1] to update the script when such update is available.
[1] I'm using Tampermonkey and so it was created and tested with it, other user script managers might also work.
'use strict';
var videoPageIntervalID = 0;
var waitingForPopup = false;
var currLocation = '';
(function() {
videoPageIntervalID = window.setInterval(onVideoPage, 1000);
})();
function waitForUpNextToDisaply() {
var selector = $("div:contains('UP NEXT')").eq(-8)
if(selector.length === 1) {
// remove the popup and cancel the play next
selector.remove();
console.log('popup removed!');
waitingForPopup = false;
return;
}
else {
setTimeout(function() {
// console.log('waiting..');
waitingForPopup = true;
if (location.href.indexOf("/videos/") != -1) {
waitForUpNextToDisaply();
} else {
waitingForPopup = false;
}
}, 500);
}
}
function onVideoPage() {
if (location.href.indexOf("/videos/") != -1 && !waitingForPopup && location.href != currLocation ) {
console.log('arrived to video page: ', location.href);
currLocation = location.href;
waitForUpNextToDisaply();
}
}
Customizing
If you want to remove the popup but still play the next video automatically, replace the 8
in $("div:contains('UP NEXT')").eq(-8)
with 10
- it will remove the whole popup object, not only the visible part and so since it doesn't exist at all, Facebook will play the next video automatically.