In the program I'm creating i need to know what browser the user is using. I don't need to open it just determine what it is. I know i can do this on windows with the registry but I have no clue about mac. I have tried looking at the Desktop.getDesktop() function but it only allows me to open the browser.
Related
hi guys I wrote a software that needs to be permanently entered into a website and then perform a browser operation then close and open it again, and each time it opens, the browser profile changes ... but usually after 10 attempts, it seems that the Internet is cut off and the website dont open, but if I create a new tab myself, I can go to the same address manually ... Why does this happen ??... I use Firefox and geockdriver and of course selenium libraries
i created multiple Geockdriver.exe and tried to use each for one profile and also i set port for driver with profile.setPreference(FirefoxProfile.PORT_PREFERENCE, 65535); but still same problem happend
by the way i code in java
selenium-firefox-driver 4.1.3
firefox version 98.0.2
We are trying to download something from GE that uses Java to download when logging into the site. This is a windows 7 Professional PC. I have other computers that are able to do this successfully. Here is my order of operations:
Log into the site and select the file I want to download
Click download
It takes me to the page that says it will start in a few seconds but nothing happens. It is supposed to have a box that asks for Java to run.
I have reinstalled Java fresh and still nothing. Tried with multiple user accounts. Added the site to the list of exceptions in the firewalls and Java configuration. I have tried an earlier version of Java. This happens in Mozilla, Chrome and IE. I have made sure that the Java plugin shows up and is enabled. I just cant think of what I am missing. And since we are a contractor GE is not going to help us. Can anyone here think of anything?
Are you sure you have the Java plugin enabled? e.g. in Firefox, go to Settings, Plugins, and change Java Platform SE8 'Next Generation Java Plugin' to 'always activate'?
This sounds similar to the issues I had with Cisco WebVPN, Java-style. Once you have Java installed correctly and set as a plugin for any of the browsers you would like to use, see below.
Before you even start looking at browsers - if you think it is already set up correctly
Look at your Anti-Virus programs or anything else that could prevent it from working. McAfee Host Intrusion Protection is known to cause many Java programs to fail. Kapersky had issues, a while back, with Java on Windows (Java Applets not loading in Windows 8 ).
You must have a 64-bit browser to use 64-bit Java (also mentioned in the Chrome link below).
See below for any specific things that can be modified in the browser.
Chrome 43 is the more complicated browser to set up. They have a dedicated page with instructions.
How do I use Java with the Google Chrome browser?
Firefox 38 will prompt you.
In Internet Explorer 11, it's under Internet Options->Security. I recommend adding the hostname the applet is on as a Trusted Site (Select Trusted Sites and click the Sites button, then add the first part of the url). Click the Custom level button and make sure that Scripting of Java applets is not disabled.
If you still have problems with the applet:
Verify your Java version will work with the applet you are accessing
Verify the plugin is enabled for the browser through the Java Control Panel, which is available in Windows Control Panel, or on Mac/Linux, execute it from the JDK directory ($JAVA_HOME/ControlPanel ).
I ended up fixing the issue. I had to allow their UK site on the list for Java and enable the SSL 2.0 for HTTP in Java config as well
In my web application I need to launch a Windows application installed on client machine when a button in the page is clicked.
I know there are security policies in browsers that avoid this by default, but I also know application that do this. An example could be online meeting, web conferencing applications like WebEx or GoToMeeting.
How they do that?
I'm working with Java, so I'm wondering if Java Applets are an option to achieve this.
Is there some other well known way to solve this issue?
NOTE application execution MUST be allowed by user
The best way to deploy a Java desktop application is using Java Web Start.
And forget applets. Soon Chrome won't be able to load them (along with a number of other plug-ins) at all.
you can achieve it with applet. but user must allow to run it. it is hard to run some extern application from button or link because this is potentially danger behaviour. Remember the applet can not get access to the files on user computer and other servers (unless it is digitally signed)
I am writing a protocol handler to launch a java application, calling a command like java -jar myApp '%1'. Currently I have implemented it for Chrome and it looks work correcly. Unfortunately I don't have the same behavior for Firefox and IE (weird uh?! X-D )
Here my implementation.
The protocol is named dgh.
During the first installation my application set the following keys in windows registry
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dgh]
#="URL:DgHome Protocol"
"URL Procol"=""
[HKEY_CLASSES_ROOT\dgh\DefaultIcon]
#="C:/DGHOME/IPlusConf.exe,1"
[HKEY_CLASSES_ROOT\dgh\shell]
[HKEY_CLASSES_ROOT\dgh\shell\open]
[HKEY_CLASSES_ROOT\dgh\shell\open\command]
#="java -jar C:/DGHOME/Pch/lib/pch.teleconsulto.jar \"%1\""
On chrome this is enough.
On Firefox, I had to add some configurations in about:config.Following MDN on Firefox I set the following
network.protocol-handler.expose.dgh;true
network.protocol-handler.external.dgh;true
network.protocol-handler.warn-external.dgh;false
In this way firefox at least ask to me if I want launch an application and ask to me to select one: I don't want that, I would it call the command I set and advise the first time the user about that:
On IE nothing happens, it says can't open the web page reference by my link.
Here a set of link I used as test
Open call to kit1.teleconsulto
<a href="dgh://teleconsult/start?id='kit1.teleconsulto'">
Open teleconsult to kit1.teleconsulto</a>
Close call
Close client
On Phonendo
here some references:
Installing and Registering Protocol Handlers
http://msdn.microsoft.com/en-us/library/aa767916%28VS.85%29.aspx
I hope sincerely someone can help me
The problem you're having is that the you're calling the jar directly in your protocol handler. You need to invoke java.exe with the -jar parameter
Your registry key should look like this
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\digitalmgi]
#="URL:digitalmgi protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\digitalmgi\DefaultIcon]
#="C:\\myCoolIcon.ico"
[HKEY_CLASSES_ROOT\digitalmgi\Shell]
[HKEY_CLASSES_ROOT\digitalmgi\Shell\Open]
[HKEY_CLASSES_ROOT\digitalmgi\Shell\Open\Command]
#="\"C:\\Program Files\\Java\\jre7\\bin\\java.exe\" -jar \"C:\\MyPath\\myJar.jar\" \"%1\""
I understand that you have taken the approach of Registering in the system's registry but, If you are willing to take a different approach then, there is a Generic solution available at Generic-Protocol-Handler which surely will address the Cross Browser compatibility issue.
Please Mark this as Answer, if it helps :)
I have a simple java applet that retrieves an image from a server and prints it out. The only problem is that I get the following java security warning:
Researching on this site and all over the web, some people suggest that I sign the applet (I tried that to no avail) and others suggest that I Modify a local java security setting but that isn't feasible for my clients.
Not only do I get this warning at the start of my applet, but seemingly any time the code attempts to interact with the printer, the dialog re-appears. Also, note that there is no checkbox next to 'Always allow this applet to access the printer'. These symptoms show on any browser.
How do I get java to respect the users choice to allow it to send jobs to the printer?
You might use the JNLP API services in a sand-boxed applet in a plug-in 2 JRE. They will still prompt the user each first time they go to print, but should also put an 'always allow' check-box on the dialog (though it really only applies for that run). See a demo. of the PrintService.
See also the applet info. page that includes a link on the Next Generation in Applet Java Plug-in Technology which "..brings new abilities to applets: such as .. allowing embedded applets to gain full access to the services of Java Web Start."