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.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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;