Parcourir la source

增加通知和音乐播放

PUGE il y a 2 ans
Parent
commit
0279a4bb96
3 fichiers modifiés avec 11 ajouts et 1 suppressions
  1. 10 0
      back/background.js
  2. 0 0
      background.js
  3. 1 1
      manifest.json

+ 10 - 0
back/background.js

@@ -102,6 +102,16 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
           reGetData('')
           reGetData('')
         })
         })
       }, 100);
       }, 100);
+    case 'notifications':
+      chrome.notifications.create(null, {
+        type: 'basic',
+        iconUrl: 'img/48.png',
+        title: message.title,
+        message: message.message
+      });
+    case 'playMusic':
+      let musicUrl = message.url ? message.url : 'https://cunchu.site/work/assist/lingyin.wav'
+      new Audio(musicUrl).play()
     default:
     default:
       break;
       break;
   }
   }

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
background.js


+ 1 - 1
manifest.json

@@ -1,7 +1,7 @@
 {
 {
 	"manifest_version": 2,
 	"manifest_version": 2,
 	"name": "脚本助手",
 	"name": "脚本助手",
-	"version": "1.1.25",
+	"version": "1.1.26",
 	"description": "脚本助手",
 	"description": "脚本助手",
 	"icons": {
 	"icons": {
 		"16": "./img/16.png",
 		"16": "./img/16.png",

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff