|
Rank: Advanced Member Groups: Member
Joined: 6/13/2014 Posts: 38
|
Hi
we are trying to restrict the back button behaviour, so if focus is on web browser control and user presses the back button it do not go to previous page. is there any event or property we need to handle set to restrict the back button.
Note: In textbox back button should work normally.
Regards, Ashish
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, EO.WebBrowser does not provide any direct support for this, however you can use WebView.InitScript to automatically inject JavaScript code into the page you load: http://www.essentialobjects.com/doc/6/eo.webbrowser.webview.jsinitcode.aspxThis page gives you sample JavaScript code on how to disable back key: http://stackoverflow.com/questions/1495219/how-can-i-prevent-the-backspace-key-from-navigating-backThe above code uses JQuery syntax, so if your page does not use JQuery, then you might want to change that. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 6/13/2014 Posts: 38
|
Hi EO_Support,
Thanks for your help. I have tried above solution and it will work for normal web pages but if there is any iframe in the web page and if user click back button this solution will not work as document.keydown will be bound to the main document element only and not with the opened iframe's document object. Is there anyway in EO that we can inject JS code when ever any iframe is loaded ?
Regards, Ashish
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
There appear to be no way to inject any js code into an iframe in the current version. It does make sense to run JSInitCode in all frames, not just top level frames though. It's something very easy for us to do but we will review a few things to make sure that it doesn't introduce any problem. If we do not see any problems, our next build will run JSInitCode in iframe as well.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
We have posted a new build on our download page that runs JSInitCode inside iframe as well. Please take a look and let us know how it goes.
Thanks!
|
|