整点闹铃
// ==UserScript==
// @name 整点闹铃
// @namespace https://bbs.tampermonkey.net.cn/
// @version 0.1.0
// @description 整点铃声提醒,可在自定义配置中添加自己喜欢的铃声~
// @author 张仨
// @grant GM_getValue
// @crontab 0 */1 * * *
// ==/UserScript==
/* ==UserConfig==
铃声选择:
music:
title: 选择铃声
description: 这是一个铃声选择的配置
type: select
default: 1
values: [1,2,3,4,5]
----
自定义铃声:
music:
title: 填写铃声MP3链接地址
description: 这是一个自定义铃声的配置
==/UserConfig== */
return new Promise((resolve, reject) => {
let mp3 = [
'https://占位.mp3',
'https://downsc.chinaz.net/Files/DownLoad/sound/huang/cd9/mp3/291.mp3',
'https://downsc.chinaz.net/Files/DownLoad/sound1/201604/7120.mp3',
'https://downsc.chinaz.net/Files/DownLoad/sound1/201210/2228.mp3',
'https://downsc.chinaz.net/Files/DownLoad/sound1/202112/15142.mp3',
'https://downsc.chinaz.net/Files/DownLoad/sound/huang/cd9/mp3/131.mp3']
let myaudio = new Audio()
myaudio.src = GM_getValue("自定义铃声.music") || mp3[GM_getValue("铃声选择.music") || 1]
myaudio.play()
resolve();
});