IMDb fullscreen imageviewer

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

16.03.2022 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

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

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

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

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

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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);

})();