Browse Source

fix: automa element selector not working

Ahmad Kholid 3 years ago
parent
commit
95a882c61d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/popup/pages/Home.vue

+ 3 - 1
src/popup/pages/Home.vue

@@ -213,10 +213,12 @@ async function initElementSelector() {
   const [tab] = await browser.tabs.query({ active: true, currentWindow: true });
 
   try {
-    await browser.tabs.sendMessage(tab.id, {
+    const result = await browser.tabs.sendMessage(tab.id, {
       type: 'automa-element-selector',
     });
 
+    if (!result) throw new Error('not-found');
+
     window.close();
   } catch (error) {
     if (error.message.includes('Could not establish connection.')) {