Disable DRM

Disable DRM.

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         Disable DRM
// @namespace    https://greasyfork.org/en/users/85671-jcunews
// @version      1.0.2
// @license      AGPLv3
// @author       jcunews
// @description  Disable DRM.
// @match        *://site-with-fake-drm.nowhere/*
// @grant        unsafeWindow
// @run-at       document-start
// ==/UserScript==

/*
This script is intended for Firefox web browser, but can also be used in Chrome.
When DRM is disabled in Firefox web browser settings, the browser still prompts user to enable DRM when the site requested the DRM's media key.
Some sites don't actually need the media key. i.e. where their video/audio medias are not actually DRM protected.
So, these kind of sites request the media key only for the sake of tracking video views.
This script automatically rejects the media key request so that Firefox don't display the Enable-DRM prompt (which if enabled,
will send a network request to retrieve the media key from the server).
This script must be manually configured for such sites, otherwise it won't do anything.
*/

(window => {
  var rmksa = navigator.requestMediaKeySystemAccess;
  window.navigator.requestMediaKeySystemAccess = function() {
    var rf, pr = new Promise(function(resolve, reject) {
      setTimeout(() => reject(), 20)
    }), pc = pr.catch;
    p.catch = function(fn) {
      rf = fn;
      return pc.apply(this, arguments)
    };
    return pr
  };
})(unsafeWindow)