IMDb fullscreen imageviewer

Fix the new layout to make it look more like the old design. Display old & new layout fullscreen.

اعتبارا من 16-03-2022. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         IMDb fullscreen imageviewer
// @namespace    https://github.com/Procyon-b
// @version      0.2
// @description  Fix the new layout to make it look more like the old design. Display old & new layout fullscreen.
// @author       Achernar
// @match        https://www.imdb.com/*/mediaviewer/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
"use strict";

var st=document.createElement("style");
st.textContent='.mediaviewer__head-banner:not(.media-viewer__action-bar) {height: 0;} .mediaviewer__head-banner + div > div {height: calc(100% + 65px) !important;} nav, footer, button[aria-label="Open"] {display: none !important;} div[data-testid="media-viewer"] {height: 100vh !important;} .media-viewer__action-bar {position: absolute; left: 0; z-index: 10; background:rgba(20, 20, 20, 0.85); border-bottom: 1px solid rgba(255,255,255,0.2);}';
document.head.appendChild(st);

function init(){
  window.dispatchEvent(new MouseEvent('resize'));
  var ms=document.querySelector('[data-testid="media-sheet"]'),
    ab=document.querySelector('[data-testid="action-bar"]');
  if (!ms || !ab) return;
  var obs=new MutationObserver(function(muts){
    for (let mut of muts) {
      if (mut.attributeName!='aria-hidden') continue;
      let t=mut.target;
      if (!t || !(t.tagName=='DIV' && t.className.includes('MediaPanel')) ) continue;
      ab.style.display= t.style.visibility=='hidden' ? 'none' : '';
      }
    });

  obs.observe(ms.closest('[data-testid="media-viewer"]'),
    {attributes: true, childList: false, subtree: true});
  }
if (document.readyState != 'loading') init();
else document.addEventListener('DOMContentLoaded', init);

})();