GoIndex Local Video Buffer

自用

当前为 2021-03-11 提交的版本,查看 最新版本

// ==UserScript==
// @name         GoIndex Local Video Buffer
// @namespace    http://tampermonkey.net/
// @description  自用
// @match        *://*.workers.dev/*
// @grant        none
// @version 1.0
// ==/UserScript==

(function () {
    'use strict';

    const ob = new MutationObserver(records =>
        records.map(record => {
            if (record.target.href.indexOf('iina://') === 0) {
                ob.disconnect()
                console.log(record.target.href)
                record.target.href = record.target.href.replace('url=', 'url=http://localhost:61234/')
            }
        })
    )
    ob.observe(document.querySelector('#app'), {
        'subtree': true,
        'attributes': true,
        'attributeFilter': ['href']
    })
})();