roshiro/TitleNotifier.js
关于
👋 轻量(< 3kb)、无依赖的 JavaScript 库,可通过简单的 API 动态在网页标题中显示未读通知数量。
开发工具实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Title Notifier js
Lightweight (< 3Kb), dependency-free javascript library to dynamically show the number of unread notifications in your webpage title.

Usage
Add title_notifier.js to your webpage.
<script src="title_notifier.js"></script>
Setting Notification
In the example below, it sets the number of notifications as 12.
titlenotifier.set(12);
Adding Notifications
Call the following function to add +1 to notifications total.
titlenotifier.add();
Subtracting Notifications
Call the following to subtract 1 from the total notifications.
titlenotifier.sub();
Reset Notifications
Call the following to set notifications to zero and the title to the original version.
titlenotifier.reset();
Get Number of Notifications (NEW)
Call the following to get the current number of notifications
titlenotifier.get();
Set Max Number of Notifications (NEW)
Call the following to set maximum number of notifications to display. Once the maximum number is reached it displays the max number plus a plus sign. If you set the max to 99 and you have 100 notifications, it will show 99+ instead of 100.
titlenotifier.max(99);
Contribute
Contributions are welcome.
探索相关项目
加载中…