GoIndex Local Video Buffer

自用

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

  1. // ==UserScript==
  2. // @name GoIndex Local Video Buffer
  3. // @namespace http://tampermonkey.net/
  4. // @description 自用
  5. // @match *://*.workers.dev/*
  6. // @grant none
  7. // @version 1.0
  8. // ==/UserScript==
  9.  
  10. (function () {
  11. 'use strict';
  12.  
  13. const ob = new MutationObserver(records =>
  14. records.map(record => {
  15. if (record.target.href.indexOf('iina://') === 0) {
  16. ob.disconnect()
  17. console.log(record.target.href)
  18. record.target.href = record.target.href.replace('url=', 'url=http://localhost:61234/')
  19. }
  20. })
  21. )
  22. ob.observe(document.querySelector('#app'), {
  23. 'subtree': true,
  24. 'attributes': true,
  25. 'attributeFilter': ['href']
  26. })
  27. })();