MovieChat.org Message Boards on m.IMDb.com

Brings message boards back on IMDb mobile site by using MovieChat.org boards.

安装此脚本?
作者推荐脚本

您可能也喜欢MovieChat.org - Mobile Companion

安装此脚本
  1. // ==UserScript==
  2. // @name MovieChat.org Message Boards on m.IMDb.com
  3. // @namespace https://greasyfork.org/en/users/105361-randomusername404
  4. // @version 1.34
  5. // @description Brings message boards back on IMDb mobile site by using MovieChat.org boards.
  6. // @run-at document-start
  7. // @include *://m.imdb.com/title/*
  8. // @include *://m.imdb.com/name/*
  9. // @exclude *://*.imdb.com/*/*/releaseinfo*
  10. // @exclude *://*.imdb.com/*/*/bio*
  11. // @exclude *://*.imdb.com/*/*/publicity*
  12. // @exclude *://*.imdb.com/*/*/otherworks*
  13. // @exclude *://*.imdb.com/*/*/awards*
  14. // @exclude *://*.imdb.com/*/*/mediaindex*
  15. // @exclude *://*.imdb.com/*/*/videogallery*
  16. // @exclude *://*.imdb.com/*/*/fullcredits*
  17. // @exclude *://*.imdb.com/*/*/plotsummary*
  18. // @exclude *://*.imdb.com/*/*/synopsis*
  19. // @exclude *://*.imdb.com/*/*/keywords*
  20. // @exclude *://*.imdb.com/*/*/parentalguide*
  21. // @exclude *://*.imdb.com/*/*/locations*
  22. // @exclude *://*.imdb.com/*/*/companycredits*
  23. // @exclude *://*.imdb.com/*/*/technical*
  24. // @exclude *://*.imdb.com/*/*/trivia*
  25. // @exclude *://*.imdb.com/*/*/soundtrack*
  26. // @exclude *://*.imdb.com/*/*/faq*
  27. // @exclude *://*.imdb.com/*/*/reviews*
  28. // @require https://code.jquery.com/jquery-3.3.1.min.js
  29. // @author RandomUsername404
  30. // @grant none
  31. // @icon http://ia.media-imdb.com/images/G/01/imdb/images/mobile/apple-touch-icon-mobile-2541571834._CB522736227_.png
  32. // ==/UserScript==
  33.  
  34. $(window).on( "load", function() {
  35. var pathname = window.location.pathname;
  36.  
  37. // Get page ID, iframe position and its dimensions
  38. var pageID;
  39. var positionReference;
  40. var width;
  41. var height = $(window).innerHeight()*0.9;
  42. if (pathname.includes("title/")) {
  43. pageID = pathname.split("title/").pop();
  44. positionReference = $('.row:last');
  45. width = $("#titleOverview").width();
  46. } else if (pathname.includes("name/")) {
  47. pageID = pathname.split("name/").pop();
  48. positionReference = $('#related-news').parent();
  49. width = $("#name-overview").width();
  50. }
  51. pageID = pageID.split("/").shift();
  52.  
  53. // Set div to put the message boards into
  54. var myDiv = document.createElement("div");
  55. $(myDiv).addClass('col-xs-12');
  56. $(myDiv).html('<h2>MovieChat Boards</h2>');
  57. $(myDiv).insertBefore(positionReference);
  58.  
  59. // Create iframe
  60. var movieChat = document.createElement("iframe");
  61. $(movieChat).attr({"src":"https://moviechat.org/" + pageID});
  62. $(movieChat).css( {"height":height+"px", "width":width+"px", "border":"none", "margin-top": "-10px"} );
  63. if (pathname.includes("title/")) {
  64. $(movieChat).css({"margin-left":"-10px"});
  65. }
  66. $(myDiv).append(movieChat);
  67.  
  68. // Add message under the iframe inviting people to visite MovieChat.org
  69. var externalLink = document.createElement("div");
  70. $(externalLink).html('<hr/><span>Discuss this topic on the <a style="color:#136cb2;" href="https://moviechat.org/' + pageID + '">MovieChat message boards »</a></span>');
  71. $(myDiv).append(externalLink);
  72. });