Page 1 of 1

Simply close the browser?

Posted: Tue Oct 11, 2016 7:15 pm
by roxter
Hi!
I am looking for a way to close my firefox browser withour knowing what content is currently presented.
There must be a simple way without even knowing the process ID I hope?
If I used recorded action I need to specify a repo item to perform the close action on.
Well the browser close action should work from any page... how to achieve this?

Re: Simply close the browser?

Posted: Tue Oct 11, 2016 7:54 pm
by krstcs
Make a repo dom object that looks like this (Mozilla likes to do things differently... :S ):

/dom[@browsername='Mozilla']

You can then use that repo object to close any dom (web page) that is in a FF browser. You may want to do this in a loop in user-code though so you get all of them, if there is more than one, like below:

Code: Select all

foreach (WebDocument dom in Host.Local.Find<WebDocument>("/dom[@browsername='Mozilla']")) {
    dom.Close();
}

Re: Simply close the browser?

Posted: Tue Oct 11, 2016 8:54 pm
by roxter
Thank you!