mirror of
https://github.com/twofas/2fas-browser-extension.git
synced 2024-11-22 02:00:08 +01:00
#1515 sendMessageToAllFrames - handle error
This commit is contained in:
parent
56f559283b
commit
eb5139671b
@ -18,6 +18,8 @@
|
||||
//
|
||||
|
||||
const browser = require('webextension-polyfill');
|
||||
const config = require('../../config');
|
||||
const TwoFasNotification = require('../notification');
|
||||
|
||||
const sendMessageToAllFrames = async (tabId, message) => {
|
||||
const frames = await browser.webNavigation.getAllFrames({ tabId });
|
||||
@ -41,8 +43,9 @@ const sendMessageToAllFrames = async (tabId, message) => {
|
||||
}
|
||||
});
|
||||
}).catch(err => {
|
||||
// @TODO: catch err
|
||||
console.error(err);
|
||||
if (err.toString().includes('Receiving end does not exist')) {
|
||||
return TwoFasNotification.show(config.Texts.Error.LackOfTab, tabId);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user