向猫抓发送一条资源的示例

示例 向猫抓发送一条资源

目前为 2022-12-06 提交的版本。查看 最新版本

// ==UserScript==
// @name         向猫抓发送一条资源的示例
// @namespace    https://bmmmd.com/
// @version      0.1
// @description  示例 向猫抓发送一条资源
// @author       bmm
// @match        https://o2bmm.gitbook.io/cat-catch/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bmmmd.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // url 资源地址
    // href 当前页面地址 一般为 location.href 即可
    // ext 资源的扩展 不带“.” 如 mp4
    // mime 资源的mime
    // referer 打开资源所需的 referer

    window.postMessage({
        action: "catCatchAddMedia",
        url: "https://github.com/xifangczy/cat-catch",
        href: location.href,
        ext: "html",
        mime: "test/text",
        referer: "https://github.com"
    });

    fetch("https://bmmmd.com/")
    .then(response => response.blob())
    .then(function (blob) {
        window.postMessage({
            action: "catCatchAddMedia",
            url: window.URL.createObjectURL(blob),
            href: location.href,
            ext: "html",
        });
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址