Skip to content

Commit

Permalink
v1.28.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Kholid060 committed Oct 6, 2023
2 parents 13b0c12 + 5b71313 commit a0af454
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "automa",
"version": "1.28.14",
"version": "1.28.15",
"description": "An extension for automating your browser by connecting blocks",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions src/content/blocksHandler/handlerForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ async function forms(block) {

async function typeText(element) {
if (block.debugMode && data.type === 'text-field') {
element.focus?.();

const commands = data.value.split('').map((char) => ({
type: 'keyDown',
text: char === '\n' ? '\r' : char,
Expand Down
33 changes: 16 additions & 17 deletions src/content/services/shortcutListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ Mousetrap.prototype.stopCallback = function () {
};

function automaCustomEventListener(findWorkflow) {
window.addEventListener(
'automa:execute-workflow',
({ detail }) => {
if (!detail || (!detail.id && !detail.publicId)) return;

const workflowId = detail.id || detail.publicId;
const workflow = findWorkflow(workflowId, Boolean(detail.publicId));

if (!workflow) return;

workflow.options = {
data: detail.data || {},
};
sendMessage('workflow:execute', workflow, 'background');
},
true
);
function customEventListener({ detail }) {
if (!detail || (!detail.id && !detail.publicId)) return;

const workflowId = detail.id || detail.publicId;
const workflow = findWorkflow(workflowId, Boolean(detail.publicId));

if (!workflow) return;

workflow.options = {
data: detail.data || {},
};
sendMessage('workflow:execute', workflow, 'background');
}

window.addEventListener('__automaExecuteWorkflow', customEventListener);
window.addEventListener('automa:execute-workflow', customEventListener);
}
function workflowShortcutsListener(findWorkflow, shortcutsObj) {
const shortcuts = Object.entries(shortcutsObj);
Expand Down
2 changes: 2 additions & 0 deletions src/utils/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ export const tasks = {
refDataKeys: [
'maxLoop',
'loopData',
'selector',
'startIndex',
'variableName',
'referenceKey',
Expand Down Expand Up @@ -819,6 +820,7 @@ export const tasks = {
maxConnection: 1,
refDataKeys: [
'maxLoop',
'selector',
'variableName',
'elementSelector',
'actionElSelector',
Expand Down
13 changes: 2 additions & 11 deletions src/workflowEngine/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,8 @@ export function attachDebugger(tabId, prevTab) {
if (prevTab && tabId !== prevTab)
chrome.debugger.detach({ tabId: prevTab });

chrome.debugger.getTargets((targets) => {
targets.forEach((target) => {
if (target.attached || target.tabId !== tabId) {
resolve();
return;
}

chrome.debugger.attach({ tabId }, '1.3', () => {
chrome.debugger.sendCommand({ tabId }, 'Page.enable', resolve);
});
});
chrome.debugger.attach({ tabId }, '1.3', () => {
chrome.debugger.sendCommand({ tabId }, 'Page.enable', resolve);
});
});
}
Expand Down

0 comments on commit a0af454

Please sign in to comment.