Explorar o código

fix: automa element selector not working

Ahmad Kholid %!s(int64=3) %!d(string=hai) anos
pai
achega
95a882c61d
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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.')) {