文字カウンター
from /customize/文字カウント
選択範囲の単語数と文字数を表示するUserScript
code:script.js
cosense.PopupMenu.addButton({
title: (text) => {
const words = text.split(/\s+/).filter(Boolean).length;
const chars = text.length;
return ${words}w ${chars}c;
},
onClick: () => null
});
変更点
単語のカウント方法を最適化した
ref. リアルタイム文字カウンター#6658a3e4ffff360000ec9178
文字数に改行を含むようにした
単語数→文字数の順番で表示されるようにした