IMDb: remove amazon ads

Removes amazon 'Watch now' ads

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 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: remove amazon ads
// @namespace      https://greatest.deepsurf.us/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();
    }
  }
});