Link to home
Start Free TrialLog in
Avatar of Richard Quadling
Richard QuadlingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Google Chrome User script to automate clicking 2 links when the links become visible.

Hi.

I've never written a Google Chrome User Script before.

There is a website that periodically opens a modal popup. The popup requires acceptance before the underlying page will be updated. When the popup isn't present the page updates automatically.

The popup does 2 things.

1 - A <div> with an ID of "confirm-acceptance" becomes visible (CSS display changed).
2 - The div contains an <a> with an onclick event of fn_AcceptanceConfirmed();

So, I want the script to call fn_AcceptanceConfirmed(); when the <div id="confirm-acceptance"> is visible.

Is this possible? Checking once every 10 minutes or so would be fine.

Clues or code would be great.


There are 2 links, but if the first one can be explained, then I can do the second.


Regards,

Richard.
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Quadling

ASKER

Thanks for that. I now need to work out how I call the click event. DispatchEvent/FireEvent logic it seems.

Cannot call the method directly due to SOP.

You've pushed me in the right direction.