IMDb Full Summary

Automatically show the full plot summary on IMDb

Från och med 2022-11-13. Se den senaste versionen.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name          IMDb Full Summary
// @description   Automatically show the full plot summary on IMDb
// @author        chocolateboy
// @copyright     chocolateboy
// @version       3.0.1
// @namespace     https://github.com/chocolateboy/userscripts
// @license       GPL
// @include       https://www.imdb.com/title/tt*
// @run-at        document-start
// @grant         none
// ==/UserScript==

// NOTE This file is generated from src/imdb-full-summary.user.ts and should not be edited directly.

"use strict";
(() => {
  // src/imdb-full-summary.user.ts
  // @license       GPL
  var $ = document;
  var init = { childList: true };
  var run = () => {
    let summary = "";
    try {
      const { textContent: metadata } = $.getElementById("__NEXT_DATA__");
      summary = JSON.parse(metadata).props.pageProps.aboveTheFoldData.plot.plotText.plainText;
    } catch (e) {
      console.warn("Can't extract summary from JSON metadata:", e);
    }
    if (!summary) {
      return;
    }
    for (const target of $.querySelectorAll('[data-testid="plot"] [data-testid^="plot-"]')) {
      const callback = () => {
        observer.disconnect();
        target.textContent = summary;
        observer.observe(target, init);
      };
      const observer = new MutationObserver(callback);
      callback();
    }
  };
  $.addEventListener("readystatechange", run, { once: true });
})();