LoginSignup
0
0

More than 1 year has passed since last update.

雀魂 新しいコメントを通知する

Last updated at Posted at 2022-10-09

スクリプトの利用は、自己責任でお願いします。

新しいコメントが来ると通知する(雀魂を開いているタブのタイトルを変える)スクリプトです。開発者ツールで実行できます。

window.titlePrefix = "(1) ";
window.notifyNewComment = () => {
    const req = {
        target_id: GameMgr.Inst.account_id,
    };
    app.NetAgent.sendReq2Lobby("Lobby", "fetchCommentList", req, (err, res) => {
        if (err || res.error) return;
        if (res.last_read_id === (res.comment_id_list[0] || 0)) {
            setTimeout(notifyNewComment, 60000);
            return;
        }
        document.title = titlePrefix + document.title;
    });
};
uiscript.UI_PlayerInfo.Inst.note.read = function() {
    uiscript.UI_PlayerNote.prototype.read.call(this);
    if (document.title.startsWith(titlePrefix)) {
        document.title = document.title.replace(titlePrefix, "");
        setTimeout(notifyNewComment, 3000);
    }
};
notifyNewComment();
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0