(options)
| 37 | * @config {string} message 内容 |
| 38 | */ |
| 39 | let notifyText = function (options) { |
| 40 | let notifyId = 'FeJson-notify-id'; |
| 41 | |
| 42 | clearTimeout(FeJson.notifyTimeoutId); |
| 43 | if (options.closeImmediately) { |
| 44 | return chrome.notifications.clear(notifyId); |
| 45 | } |
| 46 | |
| 47 | if (!options.icon) { |
| 48 | options.icon = "static/img/fe-48.png"; |
| 49 | } |
| 50 | if (!options.title) { |
| 51 | options.title = "温馨提示"; |
| 52 | } |
| 53 | chrome.notifications.create(notifyId, { |
| 54 | type: 'basic', |
| 55 | title: options.title, |
| 56 | iconUrl: chrome.runtime.getURL(options.icon), |
| 57 | message: options.message |
| 58 | }); |
| 59 | |
| 60 | FeJson.notifyTimeoutId = setTimeout(() => { |
| 61 | chrome.notifications.clear(notifyId); |
| 62 | }, parseInt(options.autoClose || 3000, 10)); |
| 63 | |
| 64 | }; |
| 65 | |
| 66 | let _getChromeLastErrorMessage = function (fallback) { |
| 67 | try { |
no test coverage detected