Browse Source

fix: element selector

Ahmad Kholid 3 years ago
parent
commit
692c3448f2
2 changed files with 6 additions and 3 deletions
  1. 1 1
      package.json
  2. 5 2
      src/content/element-selector/App.vue

+ 1 - 1
package.json

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

+ 5 - 2
src/content/element-selector/App.vue

@@ -194,7 +194,10 @@ const cardRect = reactive({
 /* eslint-disable  no-use-before-define */
 const getElementSelector = (element) =>
   state.selectorType === 'css'
-    ? getCssSelector(element)
+    ? getCssSelector(element, {
+        includeTag: true,
+        blacklist: ['[focused]', /focus/],
+      })
     : generateXPath(element);
 
 function generateXPath(element) {
@@ -305,8 +308,8 @@ function handleClick(event) {
 
   if (target === rootElement || state.hide || state.isExecuting) return;
 
-  event.preventDefault();
   event.stopPropagation();
+  event.preventDefault();
 
   const attributes = Array.from(target.attributes).map(({ name, value }) => ({
     name,