Ahmad Kholid 3 vuotta sitten
vanhempi
commit
9614e72e61

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "automa",
-  "version": "0.10.0",
+  "version": "0.11.0",
   "description": "An extension for automating your browser by connecting blocks",
   "license": "MIT",
   "repository": {

+ 11 - 5
src/background/workflow-engine/blocks-handler/handler-active-tab.js

@@ -22,6 +22,13 @@ async function activeTab(block) {
       currentWindow: true,
     });
 
+    if (!tab?.url.startsWith('http')) {
+      const error = new Error('invalid-active-tab');
+      error.data = { url: tab.url };
+
+      throw error;
+    }
+
     this.frames = await executeContentScript(tab.id);
 
     this.frameId = 0;
@@ -32,11 +39,10 @@ async function activeTab(block) {
     return data;
   } catch (error) {
     console.error(error);
-    return {
-      data: '',
-      message: error.message || error,
-      nextBlockId,
-    };
+    error.nextBlockId = nextBlockId;
+    error.data = error.data || {};
+
+    throw error;
   }
 }
 

+ 1 - 0
src/locales/en/newtab.json

@@ -92,6 +92,7 @@
       "invalid-body": "Content body is not valid",
       "workflow-disabled": "Workflow is disabled",
       "selector-empty": "Element selector is empty",
+      "invalid-active-tab": "\"{url}\" is invalid URL",
       "empty-workflow": "You must select a workflow first",
       "active-tab-removed": "Workflow active tab is removed",
       "stop-timeout": "Workflow is stopped because of timeout",

+ 1 - 1
src/newtab/pages/logs/[id].vue

@@ -194,7 +194,7 @@ onMounted(() => {
 });
 </script>
 <style>
-.logs-details .my-editor {
+.logs-details .cm-editor {
   max-height: calc(100vh - 12rem);
 }
 </style>

+ 1 - 0
src/utils/reference-data.js

@@ -49,6 +49,7 @@ export default function (block, data) {
     'fileName',
     'selector',
     'prefixText',
+    'globalData',
     'suffixText',
     'extraRowValue',
   ];