How to check the existing of "Clear browsing data" dialog using "Inject Js Script"

activities

#1

Hi everyone,

I am deleting browsing data as following:

  • Open an empty chrome page.
  • Send hotkey: Ctrl-Shift-Del.
  • Send hotkey: enter.
    My problem is I don’t know when the deleting browsing data is complete.
    after a period of study, I decided to use “Inject Js Script” activity to get html source code of web page and check the existing of “Clear browsing data” from it. Because I’m not good at java script, So I don’t know how to use java script codes to do that.
    If you have any solution for my problem, please help me.

Many thanks,
hoang anh.


#2

hi everyone,

Finally, I found the solution for my problem, that is:
I will use java script codes to check the change of page url value from chrome://settings/clearBrowserData --> chrome://settings
By that, I know exactly when the deleting browser data is complete.
Hope this helps someone who has the same problem with me.

Regards,
Hoang Anh.


#3

Instead of Js you can also use Get Attribute Activity to get the Url of a browser.

Regards…!!
Aksh


#4

Hi @aksh1yadav,

I tried to use Get Attribute activity to get the URL of browser but failed. So I decided to use Java script codes to do that instead.
Anyway, thanks you so much for your solution. I will keep that in my mind for later use.

Thanks and best Regards,
Hoang Anh.


#5

Hi Hoang
Please suggest what kind of code you used in Inject js activity.


#6

Hi @qwerty123,

the code is very simple like this:

  • document.URL
    it will return the URL value of your page.
    Hope it help.

Regards,
Hoang Anh.


#7

Thanks.


#8

You are welcome.