| 101 | }; |
| 102 | |
| 103 | let _saveContentForTab = function (tabId, withContent) { |
| 104 | if (!tabId || withContent === undefined || withContent === null) { |
| 105 | return; |
| 106 | } |
| 107 | |
| 108 | try { |
| 109 | let key = `fh-content-${tabId}`; |
| 110 | if (chrome.storage && chrome.storage.session) { |
| 111 | chrome.storage.session.set({[key]: {content: withContent}}).catch(() => {}); |
| 112 | } else { |
| 113 | FeJson[tabId] = {content: withContent}; |
| 114 | } |
| 115 | } catch (_) { |
| 116 | FeJson[tabId] = {content: withContent}; |
| 117 | } |
| 118 | }; |
| 119 | |
| 120 | let _notifyToolOpenFailure = function (tool, error) { |
| 121 | let message = `打开「${tool || '工具'}」失败:${(error && error.message) || error || '请重新点击插件图标后再试'}`; |