I'm working on a vb.net web application and want to make it to where when someone puts in a url into the browser or when someone clicks on a shortcut, a new browser window is opened but there is no back or forward, no refresh, no navigation bar, etc. Does anyone know how to do this or if it's even possible? I just want the browser shell essentially. Thanks.
I would advice against this - the browser is the users domain, don't mess with it. Are there any particular reasons for your choice of functionality?
Any ways to make this possible will be based on Javascript, and this can always be disabled by the user.
You can do this in javascript code behind cannot open new browser windows. Take a look here.
you can do this with javascript using the window.open() method.
Related
Is it anyhow possible in new relic scripted browser to interact with a popup?
Is the following possible and if yes, how can I achieve the following?
Open url "https://sample.com"
Click button with id login
A popup opens
In popup fill username and password and click submit
Popup closes
Continue within application.
Basically the popup is the piece I'm struggling with. I searched documentation but was not able to find anything on how to interact with the popup.
Thx I really appreciate your expertise
This depends on what popup is defined as - a new browser window or an element embedded in a div or iframe? Either way, here are some solutions to either one:
Switching to a new browser window: https://github.com/newrelic/quickstarts-synthetics-library/blob/main/library/TabOrWindowSwitching/script.js
New Relic forum post containing several solutions/examples: https://discuss.newrelic.com/t/how-to-handle-intermittent-pop-up/38200
I am implementing a simple webview application with only one url. I have over ridden back button function for webview navigation (which is working fine). Now my app has only one screen with webview and user visits the links inside main url and navigates using back button.
I want to know that, What is Microsoft Certification Policy as my application has only one screen so should it Close when user press back button anytime? Or Microsoft allows implementing of webview with over ridden back button functionality.
If question is still unclear Kindly tell me. I'll explain more but I need to know answer to this question.
Thanks.
You shoulld be fine, I have submitted applications which works like that myself which passed certification.
As long as the application quits when pressing the back button when there is no more "history" for the webbrowser control it shouldn't be a problem because the user still get the experience of moving "backward" in his use and can finally quit the app.
Regarding WebBrowser control and content of the app please consider this requirement:
"Your app and metadata must have distinct, substantial and legitimate content and purpose. Your app must provide functionality other than launching a webpage."
So, the application's sole functionality must not be only to launch a website.
This is not releated to back button but very important thing that need to be considered!
Best regard
I want to write code to log onto an Internet account and also click buttons to navigate to do different things such as watch for something to change. for example I would like
log on to account
click to navigate
while(until I say to stop)
watch for changes
You may look at
http://watij.com/
For automated website tests you can use Selenium.
You might not need to write code - if you use FireFox, perhaps try the iMacros addon?
You've not said what language you want to write this in -- for .NET there's http://watin.org/
I have code that opens a new window but I want to be able to edit the same one.
System.Diagnostics.Process.Start("iexplore.exe", "http://www.live.com")
I'm not sure exactly but a good pointer to start off might be to get the handle of the window you're interested in:
http://www.pocketpcdn.com/articles/dotnetcf_hwnd.html
And then separately investigate what interop messages you can send to IE to change the URL in tab X
In order of increasing difficulty and increased control/power:
Send input text to your IE process. Alt-D to focus on the navigation bar, then the URL, then ENTER.
Use MSAA to find the navigation bar and send it text, as above.
Use MSAA to get IHTMLDocument access to the browser, and then programmatically drive the browser with that, and the related interfaces.
I don't know your exact scenario, but if you can host your own instance of MSHTML, or a WebBrowser control, it will make it a lot easier to get the interfaces and do the manipulations mentioned in #3 above; doing that stuff cross-process is fraught with peril.
I just did a web search and turned up a WatiN tool that apparently wraps a lot of this work; perhaps it would be useful for you.
If you are using 2008 there is a feature where you could create a second form and then add a Webbrowser control
the page could then be called by
myForm.show
The page could then be changed with the
Webbrowser1.Url = New Uri("http://www.google.com")
Use the following code:
System.Diagnostics.Process.Start("http://www.live.com")
That is: do not invoke iexplore.exe directly – just let the system figure out which default browser to open.
This may yield two behaviours:
Either it opens a new tab in an existing Internet Explorer window,
or it creates a new window.
The important point is that this depends on a preference that can be controlled within the Internet Explorer application. If a new window opens, then this is the setting chosen by the user – do not try to override it: overriding the user’s preferences is considered bad manners.
If the users don’t want a new window opened, they can simply change that in their Internet Explorer preferences.
Shell ("explorer.exe www.google.com")
is how I'm currently opening my products ad page after successful install. However I think it would look much nicer if I could do it more like Avira does, or even a popup where there are no address bar links etc. Doing this via an inbrowser link is easy enough
<a href="http://page.com"
onClick="javascript:window.open('http://page.com','windows','width=650,height=350,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no'); return false")">Link text</a>
But how would I go about adding this functionality in VB?
If you want it to look professional, you need to use an actual browser component. VB.NET comes with one. If you are using an older version of VB, you'd need to go third party. If you want to stay with a shell open, you would have to individually target the browser command-line and pass arguments to indicate that it should not have toolbars etc.
Speaking as a user, I find castrated popup windows annoying and unproductive.
So my answer is: "don't".