您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add "Open on Letterboxd" and "Open on IMDb" buttons to movie pages on KinoPub
// ==UserScript== // @name Letterboxd and IMDb Buttons for KinoPub // @version 2.4 // @description Add "Open on Letterboxd" and "Open on IMDb" buttons to movie pages on KinoPub // @author LUXUS_FORMAT // @match https://*.dpr.ovh/item/view/* // @match https://kino.pub/item/view/* // @grant none // @namespace https://greasyfork.org/en/users/1303860 // @license MIT // ==/UserScript== (function() { 'use strict'; // Wait for the DOM to load window.addEventListener('load', function() { let imdbLink = document.querySelector('a[href*="imdb.com/title/"]'); if (imdbLink) { // Extract only the numeric part of the IMDb ID let imdbIdMatch = imdbLink.href.match(/tt(\d+)/); let imdbId = imdbIdMatch ? imdbIdMatch[1] : null; if (imdbId) { let letterboxdUrl = `https://letterboxd.com/imdb/${imdbId}`; let imdbUrl = `https://www.imdb.com/title/tt${imdbId}/`; let seenButton = document.getElementById('movie-status'); if (seenButton) { // Create Letterboxd button let letterboxdButton = document.createElement('button'); letterboxdButton.textContent = 'Open on Letterboxd'; letterboxdButton.className = seenButton.className; // Copy the class of "Уже видел" button letterboxdButton.style.marginLeft = '10px'; letterboxdButton.onclick = function() { window.open(letterboxdUrl, '_blank'); }; // Create IMDb button let imdbButton = document.createElement('button'); imdbButton.textContent = 'Open on IMDb'; imdbButton.className = seenButton.className; // Copy the class of "Уже видел" button imdbButton.style.marginLeft = '10px'; imdbButton.onclick = function() { window.open(imdbUrl, '_blank'); }; // Insert the buttons seenButton.parentNode.insertBefore(letterboxdButton, seenButton.nextSibling); letterboxdButton.parentNode.insertBefore(imdbButton, letterboxdButton.nextSibling); } } } }); })();