Print requests with content-type 'application/vnd.apple.mpegurl'

Print content-type 'application/vnd.apple.mpegurl'

Versão de: 13/04/2023. Veja: a última versão.

// ==UserScript==
// @name         Print requests with content-type 'application/vnd.apple.mpegurl'
// @namespace    http://your-domain-here/
// @version      2
// @description  Print content-type 'application/vnd.apple.mpegurl'
// @match        http://*/*
// @match        https://*/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const originalXHR = window.XMLHttpRequest;
    window.XMLHttpRequest = function() {
        const xhr = new originalXHR();

        xhr.addEventListener('load', function() {
            const contentType = xhr.getResponseHeader('content-type');
            if (contentType && contentType.includes('application/vnd.apple.mpegurl')) {
                console.log('Request with content-type "application/vnd.apple.mpegurl":', xhr);
            }
        });

        return xhr;
    };
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。