Re: [chrome-autofill] Pauses between actions

334 views
Skip to first unread message

Tom Doan

unread,
Jun 21, 2015, 10:09:00 AM6/21/15
to chrome-...@googlegroups.com
For time-sensitive actions, you'll have to use JavaScript's setTimeout() function.

On Sat, Jun 20, 2015 at 7:31 AM, <rui...@gmail.com> wrote:
Is there a way we can set this up to allow pauses between actions? Right now I have a profile setup up to select a radio button, fill in a phone number, and select an entire list. The phone number and the list depend on the radio button being pressed before they appear. So it selects the radio button, but by the time the new form items load, the number and list actions have already been done, and don't get processed on the form.

--
--
You received this message because you are subscribed to the Google Groups "Autofill Google Chrome Extension" group. To post to this group, send email to chrome-...@googlegroups.com. To unsubscribe from this group, send email to chrome-autofi...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/chrome-autofill.

---
You received this message because you are subscribed to the Google Groups "Autofill Chrome Extension" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-autofi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

deliver...@gmail.com

unread,
Aug 31, 2015, 4:06:22 AM8/31/15
to Autofill Chrome Extension
Do you have an example of how setTimeout() should be used in conjunction with Autofill? It almost seems as though a Refill() function of Autofill needs to take place after the form rules (much slower than Autofill) have finished being executed. Autofill does its job almost too well. The fields in question are indeed autofilled but the conditional rules of the form are removing them because it is taking place so fast that the form doesn't realize autofill just lapped it's logic and doesn't have time to process. I need to pause, slow down or repeat autofill. Your documentation states that the Javascript code will be evaluated last so I would think the setTimeout() wouldn't be taking place until the end which won't do any good unless there was some kind of reRun(). Please advise, Thanks! 

thdoan

unread,
Sep 1, 2015, 4:17:56 AM9/1/15
to Autofill Chrome Extension, deliver...@gmail.com
Hi, have you tried increasing the delay in the 'Other Stuff' tab?
Message has been deleted

deliver...@gmail.com

unread,
Sep 1, 2015, 4:48:46 AM9/1/15
to Autofill Chrome Extension
delay not display


On Sunday, June 21, 2015 at 9:09:00 AM UTC-5, thdoan wrote:

deliver...@gmail.com

unread,
Sep 1, 2015, 4:52:55 AM9/1/15
to Autofill Chrome Extension, deliver...@gmail.com
Ok I'll try this again. It looks like I deleted my reply by mistake so please excuse me if this actually a repeat

I have tried that. However, that seems to only delay when Autofill starts and not actually slow it down at all. When Autofill starts its like light speed regardless of the delay setting. I had experimented with setTimeout() for a while last night and it seems that it needs it's own function to operate within as well instead of a simple formula. If I could some how put the brakes a little on Autofill then the slow poke form conditional rules could maybe have a chance to catch up to get their part complete before Autofill gets there. Or....pause or even refire the Autofill task starting from the specified fields. Even better, would it maybe be possible to run Autofill on separate ranges and use the setTimeout() between them? Autofill is the first action on the form obviously and thus it triggers the form rules. I have even gone as far as moving the firing order of when each field gets filled out so that the field that needs the extra time has what it needs from the beginning and then the second part of that or the action being the last of what Autofill tends to. It matters not. It's just to fast. Thanks for your support!

coool...@gmail.com

unread,
Sep 17, 2016, 11:40:00 AM9/17/16
to Autofill Chrome Extension, deliver...@gmail.com
Facing Similar Issue - Eg. Url - https://spandan.indianoil.co.in/DBTLGrievance/index.jsp 
Need to slow down autofill so options are fetched for 2nd & 3rd drop downs. Otherwise good extension.

thdoan

unread,
Sep 18, 2016, 12:20:23 AM9/18/16
to Autofill Chrome Extension, deliver...@gmail.com, coool...@gmail.com
Ah, so you are asking for a delay in between each Autofill rule executation? OK, that's a good suggestion and I will add it to the list of features to implement for the next release.

thdoan

unread,
Sep 19, 2016, 6:57:38 AM9/19/16
to Autofill Chrome Extension, deliver...@gmail.com, coool...@gmail.com
Hi, I just implemented this for the next release, but there was a problem, so I reverted the code change. The problem is that when a page has, for example, 30 rules, then it will take about 30 seconds to completely autofill the page, which is not acceptable. This is because the delay is at a profile level; I can make the delay at a rule level, but it would require a major rewrite, and it would still not be 100% reliable since you have to guess when the dynamically generated dropdowns are ready to be selected.

May I suggest an alternative solution? Use a JavaScript rule. For example, let's say there's a State dropdown that is only populated when the Country dropdown = US:

<select id="country">...</select>
<select id="state">...</select>

Your rule would look something like this:

Type = JavaScript
Value = 
// Select country
document
.querySelector('#country').value = 'US';
// Select state when it's populated with states
var elState = document.querySelector('#state');
var timer = setInterval(function() {
 
if (elState.options.length) {
    elState
.value = 'California';
    clearInterval(timer);
 
}
}, 1000);






On Saturday, September 17, 2016 at 11:40:00 PM UTC+8, coool...@gmail.com wrote:

Amanpreet Singh

unread,
Sep 19, 2016, 7:19:43 AM9/19/16
to thdoan, Autofill Chrome Extension, deliver...@gmail.com

Can we just do it for selected controls. Like check box is false by default but we enable it only for once which i want to introduce delay. In my case i will select only for 3 drop downs and also arrange them in order.

Thanks for sharing js snippet will try that out too. But UI delay config will also be very helpful

Regards,
Amanpreet Singh

--

Regards,
Amanpreet Singh

thdoan

unread,
Sep 19, 2016, 7:46:21 AM9/19/16
to Autofill Chrome Extension, thd...@gmail.com, deliver...@gmail.com, coool...@gmail.com
What would the design be like in the UI? For instance, what would you enter for Name and Value columns?

I'm open to ideas if you have some elegant solution on how to do this. Right now I would just use JavaScript rule because it's both faster (once you learn JS) and more reliable (any delay you use will be unreliable because you don't know exactly when the other dropdowns will be ready).

Amanpreet Singh

unread,
Sep 20, 2016, 10:04:36 AM9/20/16
to thdoan, Autofill Chrome Extension, deliver...@gmail.com
So feel anywhere in web delay in only drop downs are required when options of next is linked to previous.

Eg. Country Dropdown -> State Drowdown -> District Dropdown. These then require delay as well as order of filling to be maintained.

So in UI (Only For Dropdowns) I should be able to assign order. By Dragging or dropping up or below/ Adding them to a group of linked dropdowns in further settings assign them a number also select weather this group requires Delay to be introduced and most Related drop downs would require it.

In UI, I feel we can take two approaches
  1. In your current UI only in rows i see you already have ordering as you have reorder Button. You can just add checkbox for add delay. Value of delay in MS can be configured in other stuff under "control delay"
  2. Group Controls under a group which are dependent on each other and control delay can now be part of group delay. Group of controls which behave in similar manner.
Overall i feel option 1 should be easy to implement.
--

Regards,
Amanpreet Singh

lucas....@gmail.com

unread,
Sep 21, 2016, 3:04:36 PM9/21/16
to Autofill Chrome Extension
Hi guys. I agree with Amanpreet. The option of delaying one or two seconds between filling different fields would be a great idea.

For example, in my current job, people need to fill absurd forms again and again because every time you change a field, the next one changes.

By the way, thdoan, thank you for your job, it's amazing. 

thdoan

unread,
Sep 22, 2016, 10:05:33 AM9/22/16
to Autofill Chrome Extension, thd...@gmail.com, deliver...@gmail.com, coool...@gmail.com
Hi, thanks for the suggestion.

"...when options of next is linked to previous." -- how can you determine with 100% reliability when one dropdown is "linked" to another dropdown? You would have to implement your own JavaScript interpreter since most of the linkage is using JavaScript code. That would be beyond the scope and capability of Chrome extensions.

"Overall i feel option 1 should be easy to implement." -- Yeah, this is something that can be done, but it would involve a lot of code changes and testing, so I don't know when it will get implemented. If you are in need of this feature right away, then I suggest you try the JavaScript solution since it could be a couple months before I start work on this feature, if time permits.

lucas.l...@gmail.com

unread,
Sep 30, 2016, 9:49:35 AM9/30/16
to Autofill Chrome Extension, thd...@gmail.com, deliver...@gmail.com, coool...@gmail.com
Hey,

I'm trying to use the JavaScript code you wrote above. However, the onclick event is not triggered and for so, when the first field is selected the next ones are not populated. This is my code:

document.querySelector('select[name=cb_GrupoProd]').value = '4';

setTimeout(function() {
  document.querySelector('select[name=cb_Producto]').value = '12';
}, 500);

I don't know how can I trigger the onclick event.

Sorry for my English :)

thdoan

unread,
Oct 4, 2016, 7:43:12 PM10/4/16
to Autofill Chrome Extension, thd...@gmail.com, deliver...@gmail.com, coool...@gmail.com, lucas.l...@gmail.com
Try this:

var eChange = new Event('change');
document.querySelector('select[name=cb_GrupoProd]').value = '4';
document.querySelector('select[name=cb_GrupoProd]').dispatchEvent(eChange);

setTimeout(function() {
  document.querySelector('select[name=cb_Producto]').value = '12';
  document.querySelector('select[name=cb_Producto]').dispatchEvent(eChange);
}, 500);

lucas.l...@gmail.com

unread,
Oct 6, 2016, 6:08:13 AM10/6/16
to Autofill Chrome Extension, thd...@gmail.com, deliver...@gmail.com, coool...@gmail.com, lucas.l...@gmail.com
Thanks for tour response. However, this is not working.

I have tried the two functions separately and works smoothly. Nevertheless, when I try to use it together, the second field wont autofill. It seems like if the webpage is reloading every time I change one field. Is there a solution for that?

Thanks in advance!

thdoan

unread,
Oct 6, 2016, 10:44:00 PM10/6/16
to Autofill Chrome Extension, thd...@gmail.com, deliver...@gmail.com, coool...@gmail.com, lucas.l...@gmail.com
Hi, it is difficult to troubleshoot without the actual form. Can you provide the URL to the form?
Reply all
Reply to author
Forward
0 new messages