Adding a new tab in a web brower supplied with VFP that uses the IE control - webbrowser-control

I am using a class supplied with VFP that uses the IE7 control _webview to open up a web browser and it does not have a function to add a new tab withen the browser , if I am clicking on link in a current page it will open it in IE , is there a way that the new page should open up on the foxpro browser ,
and How can I add a new tab in the browser for a new search
also is there a class that will open up a web browser in foxpro based on a more updated internet broweser

There is no tab in the control. you need to create new tabs in response of the NewWindow2 event from the webbrowser control, put a new webbrowser control on the tab, then tell the event that the new webbrowser control should be used to display the new window. Your event handler looks like this:
LPARAMETERS ppdisp, cancel
*creating new tab
newTab.ADDOBJECT("Olecontrol1", "OLEControl", "shell.explorer.2")
With newTab
.olecontrol1.Top = 0
.olecontrol1.Width = .Width
.olecontrol1.Left = 0
.olecontrol1.Height = .Height
.olecontrol1.visible = .T.
.olecontrol1.RegisterAsBrowser = .T.
.Visible = .T.
Endwith
ppDisp = newTab.olecontrol1.Object
By default the webbrowser control operates in IE7 mode. To opt-in to a new version, add a FEATURE_BROWSER_EMULATION registry key in your program's installer.

Related

Allow file explorer in Microsoft.Web.WebView2.WinForms.WebView2

I have a Winforms app with a webview but the file explorer do not open when fired inside the webview (works fine on browser) i alredy tried the following :
Dim oEnvironment As Microsoft.Web.WebView2.Core.CoreWebView2Environment
Dim opts As CoreWebView2EnvironmentOptions = New CoreWebView2EnvironmentOptions()
'opts.AdditionalBrowserArguments = "--allow-file-access-from-files"
opts.AdditionalBrowserArguments = "--disable-web-security"
oEnvironment = Await Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(String.Empty, System.IO.Path.GetTempPath(), opts)
Await browser.EnsureCoreWebView2Async(environment:=oEnvironment)
The page do nor return any error.
How can i give permissions to open that?
Update:
I have a file picker like this below, if i drag and drop the files it works, if i click "Browse" nothing appen in the webview (on browser all woks fine)

Selenium Chromedriver control issue

I have started using chrome for selenium and its working fine but when I open a new tab the control goes back to the main tab and executes the script there instead of the new tab. can someone help me how to tackle this issue.
try this
ArrayList<String> tabs2 = new ArrayList<String>(driver.getWindowHandles());
driver.switchTo().window(tabs2.get(tabs2.size()-1));
//Then do something
# Open the link in a new tab by sending key strokes on the element
# Use: Keys.CONTROL + Keys.SHIFT + Keys.RETURN to open tab on top of the stack
url.send_keys(Keys.CONTROL + Keys.RETURN)
# Save the window opener (current window)
main_window = browser.current_window_handle
# Switch tab to the new tab
browser.find_element_by_tag_name('body').send_keys(Keys.CONTROL + Keys.TAB)
# Put focus on current window which will
browser.switch_to_window(browser.window_handles[1])
# do whatever you have to do on this page

Proxy change on runtime in Awesomium

I've read bunch of Q&As but none helped me.
I'm using VB.net; added awesomium browser control on the form. I need to be able to change its proxy server on the fly (example: User clicks a button to change proxy IP & port). Would it be possible? If not maybe I could create a dynamic awesomium browser control and than add it to the form (also on button click). But still don't know how to initialize control with the proxy.
If I cannot change it while running that is fine. Can I read proxy from some file and than initialize control with that proxy?
Nevermind - below worked for me:
Dim prefs As WebPreferences = New WebPreferences()
prefs.ProxyConfig = txtProxy.Text
Dim session As WebSession = WebCore.CreateWebSession(prefs)
Dim webcontrol As WebControl = New WebControl()
webcontrol.WebSession = session
Me.panWeb.Controls.Add(webcontrol)
webcontrol.Dock = DockStyle.Fill
webcontrol.Source = New Uri(txtURL.Text)
webcontrol.Visible = True

How to open silverlight childwindow as separate browser

when click on any button it should show the silverlight childwindow as a popup but insteadof modal popup i want to open child window as separate window/browser with the url
Please try this
HtmlPopupWindowOptions options = new HtmlPopupWindowOptions();
HtmlPage.PopupWindow(new Uri(http://localhost:51327/MyprintPage.aspx), "_newWindow", options);

Keep Popup Window in WebBrowser control instead of a new window

When using the WebBrowser control, is it possible to cause popup windows to
appear within the WebBrowser control itself instead of a new window?
I can't figure out how to get the popup to appear in the same browser window. please help me :)
PS : The language I use is VB
If you have multiple tabs with WebBrowsers, use this under the "New Window" Event:
((WebBrowser)TabControl1.SelectedTab.Controls[0]).Navigate(((WebBrowser)
TabControl1.SelectedTab.Controls[0]).StatusText)
'next input <cancel[IE]>
e.Cancel = True
If just a plain browser put this under the New Window Event:
webBrowser1.Navigate(webBrowser1.StatusText)
e.Cancel = True