Konrad Gorski
Guest
|
Hi Team,
I can't find how to close just opened browser tab.
I use method Navigate2 to open new tab.
In event DocumentComplete I want to close it.
How to?
Regards
Konrad |
|
Eugene Astafiev
Guest
|
Hi Konrad,
Did you try to use the Quit method of the WebBrowser class?
The following code works like a charm on my PC:
private void IEModule_DocumentComplete(object pDisp, string url)
{
IEApp.Quit();
}
Is it what you are looking for? |
|
Konrad Gorski
Guest
|
Hi Eugene,
No, it closes browser, all tabs.
To close one tab I used simple solution (not elegant at first look), injected java-script:
page.parentWindow .execScript("window .open('', '_self', ''); window .close();");
and it works.
Regards
Konrad |
|
Eugene Astafiev
Guest
|
Hi Konrad,
Thank you for keeping us informed. I am glad to know that you have found the appropriate solution.
Good luck with your add-on project! :-) |
|