use tryCatch to simplify 7e5396a1
This commit is contained in:
parent
3c5d20f862
commit
c88438c6eb
|
@ -306,13 +306,7 @@ function updateIcon(tab, styles) {
|
|||
|
||||
function onRuntimeMessage(request, sender, sendResponse) {
|
||||
// prevent browser exception bug on sending a response to a closed tab
|
||||
sendResponse = (sendResponseOriginal =>
|
||||
data => {
|
||||
try {
|
||||
sendResponseOriginal(data);
|
||||
} catch (e) {}
|
||||
}
|
||||
)(sendResponse);
|
||||
sendResponse = (send => data => tryCatch(send, data))(sendResponse);
|
||||
switch (request.method) {
|
||||
case 'getStyles':
|
||||
getStyles(request).then(sendResponse);
|
||||
|
|
Loading…
Reference in New Issue
Block a user