Hey im having issues with a website in the jxbrowser. it seems like it is running into a timeout or whatever and then in the jxbrowser there is a dialog showing up "website not responding" and i can click on "reload" or "leave".
Can I in any way access this dialog and overwrite it? For instance everytime i would get this dont ask but go to the homepage instead?
I'm having trouble finding this if it is even possible.
I found a solution. JXBrowser has a RenderAdapter where a function exists onRenderUnresponsive wich can be overridden. Look at this: https://jxbrowser.support.teamdev.com/support/solutions/articles/9000091687-detecting-unresponsive-web-page
In my case I simply want to reload the website:
Browser browser = new Browser();
browser.addRenderListener(new RenderAdapter() {
#Override
public void onRenderUnresponsive(RenderEvent event) {
browser.reloadIgnoringCache(false);
}
});
Related
I just begin with Cefsharp on C#.
Everything works fine except Cefsharp can not execute some special links that open/run a specific application on the computer.
The link still works on other Chromium official browsers (Google Chrome), I clicked the link and it launches the application. Cefshap is not, it does nothing when I clicked the link.
The link looks something like this: "runapp://api.abcxyz/..."
How can I make it work on Cefsharp?
image show that the link works on other chromium browsers
Firstly for security reasons loading of external protocols is disabled by default. Historically you would have implemented OnProtocolExecution.
There is currently an upstream bug in OnProtocolExecution see https://bitbucket.org/chromiumembedded/cef/issues/2715/onprotocolexecution-page-goes-blank-after
You can implement a workaround using RequestHandler.OnBeforeBrowser and calling Process.Start
It would look roughly something like the following (Written in Notepad++ very quickly, there maybe minor mistakes that you'd have to correct).
public class ExampleRequestHandler : RequestHandler
{
protected override bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect)
{
if(request.Url.StartsWith("mailto:"))
{
System.Diagnostics.Process.Start(request.Url);
//Cancel navigation
return true;
}
return false;
}
}
browser.RequestHandler = new ExampleRequestHandler();
I develop RIA application using Vaadin CDI addon.
About the app : it has two views(viewA and viewB) which maintained by Navigator.
User story is pretty simple:
User enters viewA
Perform some business stuff
Redirects to viewB
Using address bar to go some external website(ex. google.com)
Press back and it goes to he lastest page what he saw(viewB), instead of viewA
Any suggestions/tips-n-tricks how to avoid redirecting to viewB, but redirect to viewA?
Vaadin Forum quiet about this thing.
Thank you
I had same problem but resolved using following code:
getUI().getNavigator().addViewChangeListener(new ViewChangeListener() {
public boolean beforeViewChange(ViewChangeEvent event) {
return changeView;
}
#Override
public void afterViewChange(ViewChangeEvent event) {
// TODO Auto-generated method stub
}});
Set changeView = true only through proper navigation's (eg: On button clicks).
This how you can avoid navigation's using browser back button. In this case if user uses any of browser buttons the view does not changes and it remains on same page.
You could override View.enter(...) in your ViewB, and, according to your application state, update your view URI using Page.getCurrent().setUriFragment(recentUrl, false);
When implementing the "Connect to QuickBooks" button in my web application I found that it pops a new window instead of just being redirected, which is very undesired in the long run of this application. Is there any way to keep the button from popping a new window and just redirect in the same tab? Or would that go against Inuit's Do's and Don'ts (1. Don't modify the appearance or behavior of this button. 2. Don't modify the code that implements this button.)
I'm assuming the command to pop a new window is in Intuit's JavaScript anywhere() function but I didn't know if there was a way to prevent it from popping a new window and just make it use the same tab, without changing their code.
Or, if there really isn't anything would it be possible to close the popped up window automatically and resume control of the previously used tab? I tried to look this solution up but didn't find anything really, or at least nothing that worked for me.
Thanks for any help.
EDIT:
I figured out how to close the the window...now it's just a matter of handling the refreshing the page it goes back to to something. I haven't quite figured out how it works yet but I ended up using:
<script type="text/javascript">
try {
var parentlocation = window.parent.opener.location.hostname;
var currentlocation = window.location.hostname;
if (parentlocation != currentlocation) {
window.location = "/default.aspx";
}
else {
window.opener.location.href = window.opener.location.href;
window.close();
}
}
catch (e) {
window.location = "/default.aspx";
}
</script>
If someone wouldn't mind explaining that code that would be awesome, but nobody has to. I just can't right now so I'll do it later on my own.
I found that it pops a new window instead of just being redirected,
Yep, this is what Intuit wants it to do.
Is there any way to keep the button from popping a new window and just
redirect in the same tab?
Nope.
Trying to do that is a great way to get Intuit to ban your application/remove it from AppCenter.
Or, if there really isn't anything would it be possible to close the
popped up window automatically and resume control of the previously
used tab?
Of course. In fact, you'll have to if you want to publish on AppCenter.
Simple Javascript - window.close();
Keep in mind that this window only has to be opened once and then never again. It's not like this is going to be a huge inconvenience to your users when they'll only need to do this once in the entire history of ever using your application.
I've got a webpage I want to hook in to my Adobe Air app. It's running JavaScript, so I can't open it in the app, but I'm trying to launch it in the default system browser.
Here's the code that's supposed to be launching the page:
public function beginModule():void {
var loader:HTMLLoader = new HTMLLoader();
var gameURL:URLRequest = new URLRequest("file:///path/to/file.html");
loader.navigateInSystemBrowser = true;
loader.load(gameURL);
}
I've also tried using
flash.net.navigateToURL(gameURL);
but that had no effect.
Every time I hit the above method, that block executes but nothing happens other than a quick cursor change-- no browser opened, no change in the app. What am I missing here?
Before you start, check if the HTML page is properly running in the browser.
To open a HTML page in flex, use the HTML tag: <mx:HTML></mx:HTML>
Something like this: https://snipt.net/anishnair/flex-show-html-page/?key=28838d54ac287180032dee000ce33a74
Thank you.
Regards,
Anish
Simply use :
navigateToURL(url,"_blank");
to navigate to the url in the web-browser.
I have a timer in my application. For every 30 min, it will hit the web services and fetch the data and updates the UI. The application was working fine till yesterday. Suddenly, because of some issue, the web services were not available for some time. During that period, Application displayed the RPC Error multiple times(More than 100 alert boxes) in alert window. Because of this alert boxes, my application was hanged and i was not able to do anything.
I have tried several approaches, but nothing worked.Finally, I have tried to use a flag. In all the approaches, this looked promising. so i have implemented it.Basically, in this approach whenever we open an alert we will set a flag.While opening and closing alert we will reset this flag. But it didn't work as expected. Is there any approach, which can help us in avoiding multiple alert windows.
Please help me, to fix this issue.
I would write wrapper for opening alerts, and use only this wrapper, not Alert.show in the code:
public class AlertWrapper {
private static var lastAlert:Alert;
public static function showAlert(text:String, title:String):void {
if (lastAlert) {
PopUpManager.removePopUp(lastAlert);
//or
//return; //ignore last alert
}
lastAlert = Alert.show(text, title, null, 4, onAlertClose);
}
private static function onAlertClose(event:CloseEvent):void {
lastAlert = null;
}
}
Imports are missing, but I hope the idea is clear.