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

Function _saveContentForTab

apps/background/background.js:103–118  ·  view source on GitHub ↗
(tabId, withContent)

Source from the content-addressed store, hash-verified

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 || '请重新点击插件图标后再试'}`;

Callers 1

background.jsFile · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected