Is there a way to load an applet in chrome extension? - java

I have written a class for my application and want to use it in making chrome extension.I tried loading applet in popup.but it seems that chrome has blocked applets. The functionality i want to embed is when user visits a page he sees a button on omnibox..when user clicks the button i want to send some page elements to my applet which processes it and saves it as a file in the filesytem. for this i want to dynamically add the applet to dom..or atleast if i can load the applet its fine!!

This is a known limitation between Java Applets and Google Chrome, for more information please refer to the following issue: http://code.google.com/p/chromium/issues/detail?id=30258

Related

Drag and drop from browser to Java application

I am working on a Java application that has the ability to accept text (in a JTextComponent) that is selected, dragged and dropped from a browser such as Chrome and IE.
Is it possible for my application to know the URL of the text I am dragging and dropping?
In other words, does the export of data from the browser contain the URL along with the highlighted text that I am dragging and would it be possible for me to access this URL in my Java application?
I know this is likely based on which browser I am using. I am just curious if this is a possibility in any of the common browsers (Chrome, Firefox , IE, etc.)
Thanks in advance!

How to control IE-hosted java applet programmatically?

I've got a need to navigate java-applet programmatically and I am not that keen on Java platform. So lets assume I've got IE process stated with appropriate java applet loaded. Next I need to have some actions taken to this particular applet, like, lets say, sending WM_COMMAND to dialog along with BN_CLICKED code like I do with Windows in C. Assuming it's not a regular window I can refer to using HWND, I would like to ask someone for recommendations on how to do this.
As I understand you want to navigate (sending keystrokes and mouse clicks) a java-applet on the client side. It depends if you own the applet (say: you have the code and can change it) or if the applet is closed source and you just want to remote it.
In the first case use javascript to automate it. Change the containing HTML page to include some Javascript and pass parameters to the applet as described in the Java Tutorials.
If the applet accepts parameters, but you cannot change the HTML page, use a GreaseMonkey alternative for IE.
Your other approach (sending Windows Messages from an extern application to IE) should also work. Start Spy++ (use the 64bit version if you are using a 64bit Windows), choose "Search - Find window..." and drag the "Finder Tool" icon over the applet and release it. You will see then the HWND and if you press search you will see the window inside IE window hierarchy. So, yes you can send keystrokes and mouse clicks to a browser.
If I would automate the browser I would use Geb. You code a "web site test" in Groovy, just look at the Geb index page.
You could try to record a navigation through the applet with FireFox + "Selenium IDE" then export it and try run it in a Java Application with the Selenium IE WebDriver.
Information about Selenium can be found here : http://docs.seleniumhq.org/
Maybe this question will also help you : How to automate Java applet?

Delay Java initialization until needed

I have a web page where sometimes I need to communicate with a device.
This device is accessed with sockets, so I have a jar file with the support libraries.
When you want to get data from the device, you press a button, and a javascript method fetches the data using the library (no java code here)
The presence of the jar makes the java machine to start as soon as you load the page.
Since there is a lot of users that don't use this option (usually they don't even have the device, to begin with), they see that as a nuisance.
Is there a posibility to delay the java loading until the button is pressed ?
I don't want to redirect them to another page, that should be done in the same page.
You can load the jar file into a seperate div created dynamically via javascript, at the time you need it.
If you want to consider loading your application with java-webstart-technology, you can implement a button similiar to what oracle has on their page here
Basically what the button does is download the required jars specified in a jnlp-file and launch it.

Java Applet Printing dialog won't go away

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."

how to run Applets on Safari(web browser)

hii every one
good morning
I have created one project on JApplet
it runs successfully on Applet window
but i want to run it on web browsers(Internet explorer , Mozilla firefox, Safari, etc.)
I m using Mac os x and i want to run it on Safari.
You have to create an html which refers to the applet. Open the html in browser.
Take a look here for the applet tag http://www.w3schools.com/TAGS/tag_applet.asp
Using Mac OS X, in /Applications/Utilities you'll find Java Preferences.app. In the Advanced tab, you can enable the Java Console, which may tell you more about what's wrong when you open your HTML page in a browser.
Also, you can edit your question to add code, etc.
Addendum: You might want to start with a known working example.

Categories

Resources