Movie trailer links on IMDB

Provides links to Yotube trailer while Browsing IMDB Movie pages

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Movie trailer links on IMDB
// @namespace   imdb.Movies.trailer.links
// @description Provides links to Yotube trailer while Browsing IMDB Movie pages
// @include     *imdb.com*
// @version     1.0
// @grant        none
// ==/UserScript==

var ratingWidget = document.getElementById("ratingWidget");
var title = ratingWidget.getElementsByTagName("strong")[0];
var overview = document.getElementById("titleYear");
var span = document.createElement("span");

overview.appendChild(span);

var link = document.createElement("a");link.innerHTML = "<img src=https://i.imgur.com/YUGI7FI.png height=16 width=16>";
link.setAttribute("target","_blank");
link.setAttribute("href","https://www.youtube.com/results?search_query=" + encodeURIComponent(title.textContent + " trailer"));
span.appendChild(document.createTextNode(' | '));
span.appendChild(link);