Fix cases when currentTab.url is falsy (reported for Yandex browser)

This commit is contained in:
ilyaigpetrov 2021-03-13 14:37:29 +00:00
parent 414e2547f3
commit e4a936c5f1

View File

@ -42,7 +42,7 @@ chrome.runtime.getBackgroundPage( (bgWindow) =>
); );
// winChrome.runtime.sendMessage({ currentTab, eventName: 'POPUP_OPENED' }); // winChrome.runtime.sendMessage({ currentTab, eventName: 'POPUP_OPENED' });
theState.flags.ifInsideOptionsPage = !currentTab || /.*:\/\/extensions\/\?options=/g.test(currentTab.url) || currentTab.url.startsWith('about:addons'); theState.flags.ifInsideOptionsPage = !(currentTab && currentTab.url) || /.*:\/\/extensions\/\?options=/g.test(currentTab.url) || currentTab.url.startsWith('about:addons');
theState.flags.ifInsideEdgeOptionsPage = theState.flags.ifInsideOptionsPage && currentTab && currentTab.url.startsWith('edge://'); theState.flags.ifInsideEdgeOptionsPage = theState.flags.ifInsideOptionsPage && currentTab && currentTab.url.startsWith('edge://');
theState.currentTab = currentTab; theState.currentTab = currentTab;