Microsoft Forms - Auto reload

514 views
Skip to first unread message

RobB

unread,
Apr 28, 2021, 1:20:30 AM4/28/21
to Autofill Chrome Extension
I would like to keep auto-reloading (auto refreshing) the Microsoft Forms page until the message "This form is currently not accepting responses" goes away and the form starts to accept the responses.

Please see the attached Capture1.png.   When the form starts to accept the responses, the page changes to Capture2.png.

I have done some research myself and here is the javascript code I have come up with:

if (document.querySelector('div.office-form-question-body') == null)
    {
        location.reload();
    }

Not sure if this is correct or not but this seems to work okay, it keeps refreshing the page but the problem is that it keeps refreshing it even when the Form has started to accept responses.

Could anyone suggest better code for refreshing the page until the Form is accepting the responses, based on code in the snapshots.

Thanks,
Capture2.PNG
Capture1.PNG
Javascipt-capture.PNG

RobB

unread,
Apr 28, 2021, 5:04:28 AM4/28/21
to Autofill Chrome Extension
Sorry forgot to include some links to the forms.

This is an example of a form that is not yet accepting responses:

.....and this is the example of a form when it starts to accept responses after the start date/time:




Robin Batra

unread,
Apr 29, 2021, 11:03:19 AM4/29/21
to chrome-...@googlegroups.com
Can anybody here please help me correct my IF statement.  I think Chrome Autofill is just ignoring the IF statement and only executing location.reload(); 

Is there a syntax error in the IF statement?  Is there a better way to do this?

Thanks for your help.




--
You received this message because you are subscribed to a topic in the Google Groups "Autofill Chrome Extension" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chrome-autofill/F6ufPPhKx1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chrome-autofi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chrome-autofill/9e8aa570-228e-4886-bf13-5890dee99e88n%40googlegroups.com.

Autofill Chrome Extension

unread,
May 30, 2021, 4:58:23 PM5/30/21
to Autofill Chrome Extension
See if this works:

if (!document.querySelector('div.office-form-question-body')) {
  setTimeout(function() {
    location.reload();
  }, 1000); // Reload after 1s delay
}

Robin Batra

unread,
May 31, 2021, 4:46:26 AM5/31/21
to chrome-...@googlegroups.com
Yes that works!  Adding a delay was what was needed.

Thank you so much for your help.



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.
To view this discussion on the web visit https://groups.google.com/d/msgid/chrome-autofill/fb5afb42-564d-41bb-9290-ca0580336c49n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages