Button from an iframe in WebBrowser does not work - codenameone

I am using the WebBrowser component. There is a button in an iframe which when clicked has to trigger redirect. The redirection is not happening and I am given the android code below to use it to make redirection work.
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setDomStorageEnabled(true);// setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setAllowContentAccess(true);
Do I have to
1. Create a cn1 plugin so I use the android code
2. Or those settings come by default with the WebBrowser component for android.
3. Or is there another stuff I have to do to get the button to work.
Thanks.

You can access any of the set* methods on the settings using BrowserComponent.setProperty() e.g.:
myBc.setProperty("AllowContentAccess", Boolean.TRUE);
Notice that this might fail if a special permission is required.

Related

Is it possible to style the Azure Maps Popup Close Button or create your own instead?

I am using the Azure Maps service in a test to see if it will work for us in a project we are developing. The map service works fine for what we need, but the popup's standard close button is extremely small. Is there a way we can apply some CSS styling to the existing close button, or can we create our own instead of using the built in one?
This is what the close button looks like on our test service now:
I figured it out!
It was rather simple. I took a guess and set the closeButton option to false, and on my button control I added a "onclick" attribute with the value of "popup.close()" and it worked just fine.

Keyboard focus problems

I am needing to use the DotNetBrowserControl inside of another application (I am an add-in in the application). The application is written in WPF and has some WinForms components.
When I try to use the WPFBrowserView in the app I can never get focus to go into the Browser Window at all (even when clicking on a the google search box for example).
When I try to use the WinformsBrowserView inside of a WindowsFormsHost control I am able to get focus into the google search box by clicking on it. However once I click focus out of the browser control (to a WPF textbox for example) I can never get Keyboard focus back into the browser (even when clicking on a textbox in the browser).
It seams I am closest on getting the WInformsBrowserView working. Does anyone have any advice on how to force focus into the browser window? Even if I could programmatically force this to happen it would be a huge help.
We have implemented force focus feature for DotNetBrowser, but it is not yet present in the current version. We plan to add it to the next version of DotNetBrowser. If you need a build with this feature present, please get in touch with us via DotNetBrowser support email, and we will provide you with a preview build.

"Back" and "Menu" button disappeared on Javascript Build when using android Theme

After send a javascript build with androidTheme (override the default iOS theme), the output javascript apps works properly, just the "ActionBar" (Back,Menu) button do not appear (yes, there is Commands added into the form)
This make my build javascript apps with androidTheme cannot perform Command action or even "Back" command.
Any idea to solve this issue? If I use default iOS theme, the command is added automatically into the top/bottom bar.
This seems to be a continuation of the discussion here.
Generally commands are not portable unless you use the Toolbar API at which point they become cross platform. The iOS theme uses the StatusBar style to space the title so you can just set that UIID to 0 but if you build a native iOS app that might be an issue.

WebBrowser control doesn't open links

I'm using the default WebBrowser control inside a WPF application. HTML code is loaded using NavigateToString method (html is passed as a parameter).
Pages render correctly, but users aren't able to click on any links (nothing happens when they click on the links). The problem was partly solved by adding the URLs to trusted zone, but that is not always possible.
Are there any configurations that should be adjusted in IE (or wherever else) that would allow opening any links inside an embedded WebBrowser?
in my case using MyWebBrowser.Navigate(new Uri(...)); works, and hyperlinks work as designed but when i use MyWebBrowser.NavigateToString(htmlContent); hyperlinks stop working

Do WPF hyperlinks only work in pages?

I'm new to the Hyperlink control. I wish to have a hyperlink in a regular WPF window which will navigate to a URL by opening the standard browser. I have added the hyperlink, but it does nothing.
Before I implement a handler to do the work myself, can anyone please confirm that the Hyperlink control will navigate only within pages?
You will need to do it yourself.
The simplest way to do it is to handle the Hyperlink.RequestNavigate event and call Process.Start with the URL. (This will open the default browser).

Resources