Greasy Fork

Greasy Fork is available in English.

IMDb: remove amazon ads

Removes amazon 'Watch now' ads

当前为 2016-02-17 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           IMDb: remove amazon ads
// @namespace      http://greasyfork.icu/en/users/8981-buzz
// @description    Removes amazon 'Watch now' ads
// @author         buzz
// @require        https://code.jquery.com/jquery-2.2.0.min.js
// @version        0.2
// @license        GPLv2
// @match          http://*.imdb.com/title/tt*
// @grant          none
// ==/UserScript==
/* jshint -W097 */
'use strict';

$(function($) {
  var $watchbar = $('.watchbar2'), $el;
  if ($watchbar.length === 1) {
    var $parpar = $watchbar.parent().parent();
    if ($parpar.hasClass('article')) {
      $el = $parpar;
    }
    else {
      $el = $('.watchbar2').parent();
    }
    var text = $el.text();
    $el.find('script').each(function() {
      text = text.replace($(this).text(), '');
    });
    text = text.toLowerCase();
    if (text.indexOf('amazon') > 0 || text.indexOf('watch') > 0 || text.indexOf('disc') > 0) {
      $el.hide();
    }
    else {
      $el.show();
    }
  }
});