Assign certain website to refresh only once after page load

Discussions and Tech Support related to the iMacros Google Chrome extension.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
ims_deployment
Posts: 2
Joined: Fri Jan 25, 2019 1:45 pm

Assign certain website to refresh only once after page load

Post by ims_deployment » Fri Jan 25, 2019 2:23 pm

I have a chrome extension the need to run on assigned websites it fails to trigger all the time but it correctly runs if the page is refreshed. So I need a macro script or how do I accomplish this. What I need the iMaco what to do, is milliseconds after a page is almost finished loading the imacro will (F5) refresh the page and only refresh it once. Only want it to imacro to refresh the page once and only once and I need to have this also be set to only Ceritain domain names. Thank you
chivracq
Posts: 8781
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Assign certain website to refresh only once after page load

Post by chivracq » Fri Jan 25, 2019 10:34 pm

ims_deployment wrote:
Fri Jan 25, 2019 2:23 pm
I have a chrome extension the need to run on assigned websites it fails to trigger all the time but it correctly runs if the page is refreshed. So I need a macro script or how do I accomplish this. What I need the iMaco what to do, is milliseconds after a page is almost finished loading the imacro will (F5) refresh the page and only refresh it once. Only want it to imacro to refresh the page once and only once and I need to have this also be set to only Ceritain domain names. Thank you
Fouff..., not sure I exactly understand what you want from your Description in very approx English, correct Spelling is "iMacros" btw, you didn't manage one single time to spell it correctly...

"milliseconds after" + "almost finished loading" are btw a bit contradictory and not really "compatible"... :?

But yep, from what I understand from your a bit unclear Description, what you want is possible in iMacros..., using all different '!TIMEOUT_xxx' Commands + 'WAIT', and '!URLCURRENT' or a '.CSV' as a DataSource + 'EVAL()' for any Conditional Logic about your specific Domain Names... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
ims_deployment
Posts: 2
Joined: Fri Jan 25, 2019 1:45 pm

Re: Assign certain website to refresh only once after page load

Post by ims_deployment » Wed Jan 30, 2019 1:43 pm

I have an extension for the Chrome web browser it removes unnecessary data, adds and text. It used for for printing or screenshot capture. The extension fails to work correctly so every website visited you have to hit the F5 key to force the page to refresh then the chrome extension does work I like to set this up automatically using imacros and only run on certain domains but it always listening. It will also run a link is pressed it trigers a refresh for nested links. It also has to trigger before the page loads completely then screen capture works appropriately. Can you provide me with some test code i can try. Thank you
chivracq
Posts: 8781
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Assign certain website to refresh only once after page load

Post by chivracq » Wed Jan 30, 2019 5:16 pm

ims_deployment wrote:
Wed Jan 30, 2019 1:43 pm
I have an extension for the Chrome web browser it removes unnecessary data, adds and text. It used for for printing or screenshot capture. The extension fails to work correctly so every website visited you have to hit the F5 key to force the page to refresh then the chrome extension does work I like to set this up automatically using imacros and only run on certain domains but it always listening. It will also run a link is pressed it trigers a refresh for nested links. It also has to trigger before the page loads completely then screen capture works appropriately. Can you provide me with some test code i can try. Thank you
Okaaaaay..., slowly starting to get a "picture" of your Situation/Scenario even if that Description would be much clearer if you provided some concrete Example(s) with some URL(s) and the name/Link of that mysterious Chrome Extension...

iMacros actually waits until a Page has fully loaded before processing with the next Command in a Script and the Result of a Screenshot on Pages that didn't completely finish to load could prove to be a little bit "unreliable" and probably not very consistent, I would think..., but I could think of a way to force indeed the Script not to wait for a Page to finish loading, which would slow down your Script actually as it would require refreshing the same Page once or twice extra to measure the exact Time needed to load that Page (using '!STOPWATCH') to then dynamically set '!TIMEOUT_PAGE' deliberately to 1 or 2 sec shorter, maybe combined with a mini-'WAIT' if you need "Granularity" up to the Millisecond(s)...

This would be "interesting" Functionality actually, first time sbd is asking about that, I think... 8)

And depending on "where" you get your URL's from (I had already mentioned '.CSV' + 'DataSource' in my previous Reply), and if you regularly reuse the same URL's/Domains, it would be possible to store those Loading Times in a '.CSV' to pick them up directly next time you run the same Script on a same URL/Domain to avoid the extra Page Reloads to speed up Execution after maybe 1-2-3 different URL's/Domains to check if the previously recorded Times are still "correct" or if the computed Value(s) for '!TIMEOUT_PAGE' (+ 'WAIT') need to be adjusted as Page Loading Time will never be exactly the same every time you go to a certain Site (depends on the Web-Server and your own Internet Connection at that time)...

Pretty interesting Functionality, kind of "touching" to AI and Machine Learning...! 8)
I use a similar Functionality in one of my Scripts actually, where I need to determine in advance how long a Page will take to load at that moment to trigger a Refresh at a very specific time, and my Implementation could indeed still be improved with the Possibilities I just mentioned..., ah-ah...! :oops:

And, nope...!, I don't "provide some test code" when FCI is not mentioned in a Thread (read my Sig, I actually usually don't even reply "normally" to that kind of Threads...), + no URL(s) posted, and + no Script posted of what you've tried and where you "really" get/got stuck... I don't write Scripts for other Users, I only help Users who really get stuck after they've really tried "their best", ah-ah...! :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply