MCPcopy Create free account
hub / github.com/zxlie/FeHelper / notifyText

Function notifyText

apps/background/background.js:39–64  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

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 {

Callers 5

_notifyToolOpenFailureFunction · 0.70
_injectContentScriptsFunction · 0.70
background.jsFile · 0.70
_updateBrowserActionFunction · 0.70
_addExtensionListenerFunction · 0.70

Calls 2

setTimeoutFunction · 0.85
clearMethod · 0.80

Tested by

no test coverage detected