diff --git a/background/background.js b/background/background.js index c94b2525..0d5be065 100644 --- a/background/background.js +++ b/background/background.js @@ -346,12 +346,12 @@ function closeTab(tabId, request) { const {lastError} = chrome.runtime; if (lastError) { resolve({ - status: 'error', + success: false, error: lastError.message || String(lastError) }); return; } - resolve({status: 'success'}); + resolve({success: true}); }); }); } diff --git a/background/usercss-helper.js b/background/usercss-helper.js index 26bf92d8..f2d7521d 100644 --- a/background/usercss-helper.js +++ b/background/usercss-helper.js @@ -22,8 +22,8 @@ var usercssHelper = (() => { } function wrapReject(pending) { - return pending.then(result => ({status: 'success', result})) - .catch(err => ({status: 'error', result: err.message || String(err)})); + return pending.then(result => ({success: true, result})) + .catch(err => ({success: false, result: err.message || String(err)})); } // Parse the source and find the duplication diff --git a/content/util.js b/content/util.js index c639440f..34160e87 100644 --- a/content/util.js +++ b/content/util.js @@ -4,7 +4,7 @@ function runtimeSend(request) { return new Promise((resolve, reject) => { chrome.runtime.sendMessage( request, - ({status, result}) => (status === 'error' ? reject : resolve)(result) + ({success, result}) => (success ? resolve : reject)(result) ); }); }