Remove 'Open app' bar

7/11/2025, 11:02:20 AM

// ==UserScript==
// @name        Remove 'Open app' bar
// @namespace   Violentmonkey Scripts
// @match       *://*.facebook.com/*
// @grant       none
// @version     1.0
// @author      -
// @description 7/11/2025, 11:02:20 AM
// @license MIT
// ==/UserScript==

(function () {
  "use strict";

  function zap() {
    document.querySelector('#screen-root > div > div.m.fixed-container.bottom')?.remove();
  }
  zap();

  const observer = new MutationObserver(() => zap());
  observer.observe(document.documentElement, {
    childList: true,
    subtree: true,
  });

  ['pushState', 'replaceState'].forEach(fn => {
    const orig = history[fn];
    history[fn] = function (...args) {
      const ret = orig.apply(this, args);
      Promise.resolve().then(zap);
      return ret;
    };
  });
})();