您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fix the new layout to make it look more like the old design. Display old & new layout fullscreen.
当前为
- // ==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);
- })();