スクリプトの利用は、自己責任でお願いします。
新しいコメントが来ると通知する(雀魂を開いているタブのタイトルを変える)スクリプトです。開発者ツールで実行できます。
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();