IMDb Full Gallery Redirect

Clicking the photos section title or more image will open the full tiled view gallery page instead of a single photo.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        IMDb Full Gallery Redirect
// @namespace   https://greasyfork.org/users/636724-cml99
// @match       http*://*imdb.com/title/*
// @match       http*://*imdb.com/name/*
// @grant       GM_xmlhttpRequest
// @grant       GM.xmlHttpRequest
// @grant       GM_addStyle
// @version     1.0.1
// @author      CML99
// @license     CC-BY-NC-SA-4.0
// @description Clicking the photos section title or more image will open the full tiled view gallery page instead of a single photo.
// @icon        https://www.google.com/s2/favicons?sz=64&domain=imdb.com
// ==/UserScript==


var photosTitle = document.querySelector('.ipc-page-section[data-testid="Photos"] a.ipc-title-link-wrapper');
var photosMore = document.querySelector('.ipc-page-section[data-testid="Photos"] a.hide-b-m');

var photosTitleActor = document.querySelector('.ipc-page-wrapper:has(div[data-testid="Filmography"]) .ipc-page-section[data-testid="Photos"] a.ipc-title-link-wrapper');
var photosMoreActor = document.querySelector('.ipc-page-wrapper:has(div[data-testid="Filmography"]) .ipc-page-section[data-testid="Photos"] a.hide-b-m');

const urlSplit = window.location.pathname.split('/').filter(segment => segment);
let ttid = urlSplit[1];

let galleryLink = 'https://www.imdb.com/title/' + ttid + '/mediaindex/';
let galleryLinkActor = 'https://www.imdb.com/name/' + ttid + '/mediaindex/';

photosTitle.href = galleryLink;
photosMore.href = galleryLink;
photosTitleActor.href = galleryLinkActor;
photosMoreActor.href = galleryLinkActor;