Remove Facebook Play Next Popup

Removes the annoying UP NEXT popup from Facebook videos and cancels the next video play automatically.

当前为 2018-06-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Remove Facebook Play Next Popup
  3. // @description Removes the annoying UP NEXT popup from Facebook videos and cancels the next video play automatically.
  4. // @version 0.1
  5. // @author Ariel Jannai
  6. // @namespace https://github.com/arieljannai/tampermonkey-scripts
  7. // @supportURL https://github.com/arieljannai/tampermonkey-scripts/issues
  8. // @match https://www.facebook.com/*/videos/*
  9. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. 'use strict';
  14.  
  15. (function waitForUpNextToDisaply() {
  16. var selector = $("div:contains('UP NEXT')").eq(-8)
  17. if(selector.length === 1) {
  18. // remove the popup and cancel the play next
  19. selector.remove();
  20. console.log('popup removed!');
  21. return;
  22. }
  23. else {
  24. setTimeout(function() {
  25. waitForUpNextToDisaply();
  26. }, 500);
  27. }
  28. })();