Greasy Fork

碧蓝幻想手机通知助手

碧蓝幻想副本打完后,手机收到通知

目前为 2023-05-02 提交的版本。查看 最新版本

// ==UserScript==
// @name         碧蓝幻想手机通知助手
// @namespace    muu
// @version      0.2
// @description  碧蓝幻想副本打完后,手机收到通知
// @author       muu
// @license      MIT
// @match        *://game.granbluefantasy.jp/*
// @match        *://gbf.game.mbga.jp/*
// @icon         http://game.granbluefantasy.jp/favicon.ico
// @run-at       document-end
// @grant        GM_notification
// @grant        GM_xmlhttpRequest
// @connect      *
// ==/UserScript==

(function () {
    'use strict';
    const jsonData = {
        "msgtype": "text",
        "text": {
            "content": "碧蓝幻想打完了"
        }
    }
    window.addEventListener('hashchange', () => {
        let hash = location.hash
        if (/^#result_multi\/\d/.test(hash)) {
            GM_notification({
                title: '碧蓝幻想打完了',
                text: '看一下',
                timeout: 2000
            })
            GM_xmlhttpRequest({
                method: "GET",//钉钉通知,为POST;QQ和微信为GET
                url: "",//在引号内填入你的url

                //如使用钉钉通知,将下四行前的"//"去掉
                //headers: {
                //    "Content-Type": 'application/json;charset=utf-8'
                //},
                //data: JSON.stringify(jsonData)
            })
        }
    })
}());