browser-automation / cba Goto Github PK
View Code? Open in Web Editor NEWChromium Browser Automation (extension for chrome browser automation).
Home Page: https://chrome-automation.com
License: GNU General Public License v3.0
Chromium Browser Automation (extension for chrome browser automation).
Home Page: https://chrome-automation.com
License: GNU General Public License v3.0
Currently timer actions looks like this:
{
type: "timer",
inputs: ["Please enter the time in milliseconds", "1000"],
info: "Please enter the time in milliseconds"
}
Main input in the example is "1000", while the other input is obsolete and needs to be replaced with info in UI by #44 .
as mentioned here -> https://chrome-automation.com/bg-inject
Copy action currently is copying the HTML inside the element, question is if we need to change that to the textContent, in general we might want to either introduce copying the textContent in addition or instead copying HTML.
In the website we do have an example below, which we should ensure keeps working:
sendBgInstruction = false; // Stop workflow of the CBA
chrome.windows.create({ url: clipboard["scrAlias"]}, function(){
sendInstruction(); // Continue with CBA workflow
});
We are using window.localStorage instead of browser.storage.locale.
We need to ensure that migration won't affect the user data when updating the extension version and most importantly the extension won't be disabled because of the new permission.
Currently the we take href of the anchor and create a redirection, that might have been because previously browsers weren't handling click on the anchor. With #3 we ensured that redirection works fine when clicking anchor, considering that there doesn't seem to be a reason why we need to register redirect, maybe we can use generic click actions.
If the anchor is redirecting to another page, record submit-click
action, otherwise click
.
THis seem to be because of flexible width.
Currently we stopButtonClick()
, recordButtonClick()
and playButtonClick()
are adde to the global variable in background in order to make it accessible from other pages. Ideally we would use message passing instead, but the problem is that we need to find a way to test it from the puppeteer, while in puppeteer running chrome.runtime.sendMessage
in background page result in Could not establish connection. Receiving end does not exist
error, as it's trying to send message in the same frame we are listening(in background).
Find a way how to use message passing for stopButtonClick()
, recordButtonClick()
and playButtonClick()
and same time be able to test in puppeteer.
Ensure that both recording and playing does work in the iframe as well.
bg-inject action is being executed in the extension context, we should move it into Sandboxed pages if possible.
Ensure that bg-inject can be executed in a sandbox page.
From:
{"group0":
{ "name":"group0",
"level":"0",
"parent":"",
"isLeaf":false,
"expanded":true,
"loaded":true,
"projects":
[{ "action":
[{"data":
"#SIvCob",
"evType":"copy",
"newValue":""
},
{ "data":".gLFyf.gsfi",
"evType":"change",
"newValue":"<$clipboard=copy>"
},
{ "data":"alert(\"Hello World\");",
"evType":"inject","newValue":"","name":"alert"
}
],
"name":"project",
"level":"1",
"isLeaf":true,
"expanded":false,
"loaded":true
}
...
To:
[
{
"data": {
"type": "group"
},
"text": "group0",
"subItems": [
{
"data": {
"type": "project"
},
"text": "project0"
}
]
}
]
Previously we use clipboard as a global variable in the background, but now we have introduced cba object, which we are mostly might use instead, the question is if we would like to continue supporting clipboard variable in the bg-inject action, or make sense start switching to cba.clipboard.
example usage:
sendBgInstruction = false; // Stop workflow of the CBA
chrome.windows.create({ url: clipboard["scrAlias"]}, function(){
sendInstruction(); // Continue with CBA workflow
});
Update: Decision was made to support legacy clipboard
instead, as we can't maintain two objects easily.
With #44 we have introduced info tooltip next to the action select input.
Ensure that tooltip doesn't overflow the actual selectbox.
"collections" - Contains groups, groups has sub_items(projects) and each project has actions.
"predefinedActions" - Custom actions as seen in Functions table
"tab" - Remember which tab was opened last
The questionable namings are: "collections" and "predefinedActions", should we keep those or find better naming?
Currently actions are represented with current fields:
rename:
collections
-> projects
predefinedActions
-> customActions
Reorganize actions:
string
)array
)string
)bg-inject is quite powerful tool and user should ensure he that is not executing any evil script.
Introduce a warning for the projects that have bg-inject
action so users never try executing any 3-rd party script they don't trust.
Currently there is only way to run all tests, unless tests/config.js
file is modified.
Provide ability to run a specific test file or a test inside of a file.
We used to have ready function below, we might need to introduce an alternative to this.
function requestService(type, url, data) {
$.ajax({
type : type,
url : url,
data : data
}).done(function(msg) {
cba.clipboard["serviceAnswer"] = msg;
sendInstruction();
});
}
With #40 we have introduced info
for action which suppose to be replace misused inputs as information text.
Introduce a UI information element which suppose to hint users how to use specific actions using data from the "info".
Click action on the link doesn't seem to trigger redirect
Current getPath
method which suppose to get the path to the target item, only get's tree-path, consider example:
<body>
<input type="submit" />
<input type="image" />
<input type="text" />
<input type="password" />
</body>
Clicking any input item will result in path being body div INPUT
submit-click action in comparison to the regular click waits for an update event to be fired by the tab in order to continue the execution flow, even though it's useful when clicking on submit buttons which redirect you to another page, but the name itself making the action unintuitive.
click-update
click-wait-update
While rewriting the extension we have deprecated few methods, but yet keeping backwards compatibility, this issue is for tracking those and addressing in the website.
sendBgInstruction
and sendInstruction()
-> Use async/await instead.
copy
-> copy-html
- copies innerHTML.
copy
-> copies textContent
submit-click
-> click-update
Here we do check for the timer though seems like we only care about it in the background.
When using change
event it's expected that the event is fired, while it's not necessarily true as we are using Jquery's .change() method, which might only work with Jquery?
No need to use Jquery for the development of CBA.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.