|
@@ -115,30 +115,37 @@ function thenInstalledMethod() {
|
|
|
} catch (error) {
|
|
|
Report.reportLog({
|
|
|
objectType: Report.objectType.background_function_catch,
|
|
|
- funcName: 'onInstalledMethod',
|
|
|
+ funcName: 'thenInstalledMethod',
|
|
|
errMsg: error.message
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
function onInstalledMethod() {
|
|
|
- // 版本更新判断
|
|
|
- getChromeStorage('baseInfo', (info) => {
|
|
|
- if (!info || !info.appVersionCode) {
|
|
|
- setChromeStorage({ baseInfo: JSON.stringify({ appVersionCode }) })
|
|
|
- thenInstalledMethod()
|
|
|
- } else if (appVersionCode != info.appVersionCode) {
|
|
|
- setChromeStorage({ baseInfo: JSON.stringify({ appVersionCode }) }, () => {
|
|
|
- chrome.runtime.reload()
|
|
|
- })
|
|
|
- } else {
|
|
|
- thenInstalledMethod()
|
|
|
- }
|
|
|
- })
|
|
|
+ try {
|
|
|
+ // 版本更新判断
|
|
|
+ getChromeStorage('baseInfo', (info) => {
|
|
|
+ if (!info || !info.appVersionCode) {
|
|
|
+ setChromeStorage({ baseInfo: JSON.stringify({ appVersionCode }) })
|
|
|
+ thenInstalledMethod()
|
|
|
+ } else if (appVersionCode != info.appVersionCode) {
|
|
|
+ setChromeStorage({ baseInfo: JSON.stringify({ appVersionCode }) }, () => {
|
|
|
+ chrome.runtime.reload()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ thenInstalledMethod()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ Report.reportLog({
|
|
|
+ objectType: Report.objectType.background_function_catch,
|
|
|
+ funcName: 'onInstalledMethod',
|
|
|
+ errMsg: error.message
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function onMessageMethod(req, sender, sendResponse) {
|
|
|
try {
|
|
|
-
|
|
|
if (req) {
|
|
|
switch (req.actionType) {
|
|
|
case "POPUP_LOGIN":
|