Links on Netflix - IMDB, Rotten Tomatoes, Metacritic

Add links for searching titles from netflix.com

当前为 2022-01-04 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Links on Netflix - IMDB, Rotten Tomatoes, Metacritic
// @description  Add links for searching titles from netflix.com
// @version      0.7
// @author       mica
// @namespace    greasyfork.org/users/12559
// @include      https://www.netflix.com/browse*
// @include      https://www.netflix.com/title/*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @grant        none
// @license      MIT
// ==/UserScript==
 
$('head').append(`
    <style>
        #sbox {margin: 4px 0 0 4px}
        #sbox a {margin: 0 8px}
        #sbox img {width: 24px; height: 24px;}
    </style>
`);
var url;
setInterval(function() {
    if (url != location.href) {
        url = location.href;
        $('#sbox').remove();
        setTimeout(function() {
            var title = $('.about-header > h3 > strong').text();
            var mc = 'https://www.metacritic.com/search/all/' + encodeURIComponent(title.replace(/\*|\//g,' ')) + '/results';
            var imdb = 'https://www.imdb.com/find?s=tt&ref_=fn_tt&q=' + encodeURIComponent(title);
            var rt = 'https://www.rottentomatoes.com/search/?search=' + encodeURIComponent(title);
            $('[data-uia|="videoMetadata--container"]:first').append([
                $('<div>').attr('id', 'sbox').append([
                    $('<a>').attr('href', mc).attr('target', '_blank').html('<img src="https://www.metacritic.com/favicon.ico">'),
                    $('<a>').attr('href', imdb).attr('target', '_blank').html('<img src="https://www.imdb.com/favicon.ico">'),
                    $('<a>').attr('href', rt).attr('target', '_blank').html('<img src="https://www.rottentomatoes.com/favicon.ico">')
                ])
            ]);
        }, 1000);
    }
}, 100);