Links on Netflix - IMDB, Rotten Tomatoes, Metacritic, YouTube Trailers

Adds links for searching titles from netflix.com

Verze ze dne 24. 05. 2023. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Links on Netflix - IMDB, Rotten Tomatoes, Metacritic, YouTube Trailers
// @description  Adds links for searching titles from netflix.com
// @version      1.1
// @author       mica
// @namespace    greatest.deepsurf.us/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
// @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);
            var yt = 'https://www.youtube.com/results?search_query=' + encodeURIComponent(title) + ' trailer'
            $('[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/assets/pizza-pie/images/favicon.ico">'),
                    $('<a>').attr('href', yt).attr('target', '_blank').html('<img src="https://www.youtube.com/s/desktop/f4861452/img/favicon_32x32.png">')
                ])
            ]);
        }, 1000);
    }
}, 100);