Amazon HEVC Enabler

Enable HEVC streams for Amazon Video

/* eslint-env browser */

// ==UserScript==
// @name         Amazon HEVC Enabler
// @namespace    [email protected]
// @version      0.1.7
// @description  Enable HEVC streams for Amazon Video
// @author       nyuszika7h
// @match        https://www.amazon.com/*
// @match        https://www.amazon.co.uk/*
// @match        https://www.amazon.de/*
// @match        https://www.amazon.co.jp/*
// @match        https://www.primevideo.com/*
// @grant        none
// ==/UserScript==

(function () {
  'use strict';
  (function (open) {
    XMLHttpRequest.prototype.open = function () {
      arguments[1] = arguments[1].replace('deviceVideoCodecOverride=H264', 'deviceVideoCodecOverride=H265').replace('~', '')
      open.apply(this, arguments)
    }
  })(XMLHttpRequest.prototype.open)
})()