IMDb: remove amazon ads

Removes amazon 'Watch now' ads

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

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

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           IMDb: remove amazon ads
// @namespace      https://greasyfork.org/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.3
// @license        GPLv2
// @match          *://*.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();
    }
  }
});