Browser window control focus - java

I'm working on a web app that interfaces with TWAIN devices (document scanners). JavaScript sets a Java applet's boolean that triggers it to pull up the scanner interface. When the TWAIN interface is shown it is sometimes behind the browser window. It sounds like there's no way to set the TWAIN window visible, so instead I need to send the browser window backwards to be behind it. I have tried JavaScript window.blur() and also Java setVisible(false) in my applet and neither seem to work. Keep in mind I don't have any popup windows, the applet is embedded in the only browser window. I have read that JNI is capable of this but cannot find any examples. I am capable of using JNI because my applet is signed, although I'd prefer a JavaScript solution as it would be easier to implement.

Related

Screenshot Entire Environment from Browser

I have an internal web application and I want to be able to take a screenshot of the user's entire desktop environment through the app, not just the browser window. In my research, I've found that I could do this using a Java applet. However, Java applets are no longer supported in Chrome as of v45, and they tend to be slow and dated. I've explored the possibility of using flash or a browser extension, but it appears that I would only be able to capture the browser window through these means. I'd prefer not to use a native application, as the screen capture is to be a feature of the web app, so I'd like to keep them as tightly coupled as possible.
Specifically, are there any other methods that I am missing to achieve what I'd like to do? I've sort of resided myself to a java applet sans chrome support or a separate native app, but I've had trouble finding literature online about my use case (assumably due to the security concerns).

Can a JavaFX 2 applet request focus and so focus on browser / tab?

I'm wondering if there would be any solution to show and focus on browser's tab containing a javafx 2 applet programmatically from the applet.
I don't think there's a simple solution, but who knows :)
PS : Obviously, stage.requestFocus() and stage.toFront() don't work.
No, there's absolutely no way to do this using no custom native bridge doing the job, even with a javascript bridge.
With the next versions of JavaFX neither.
And applets are not supported anymore in Chrome, so I think nobody would try that anymore.

SWT listener for JavaScript window.resizeTo?

I'm working on an application that uses the SWT Browser widget to display an HTML page with some JavaScript in it. The JavaScript tries to use window.resizeTo to change the size of the window, but it currently isn't having any effect.
I've fiddled with the browser settings, and it doesn't seem to be an issue with the underlying browser; switching between Mozilla and Internet Explorer rendering engines has no effect. I suspect that SWT simply doesn't automatically re-size the window in response to JavaScript functions.
I can easily re-size the window from my Java code, but I need to know when to re-size it, and how big JavaScript wants it to be. Does SWT provide a way to listen for this? If so, how?
I still don't know of any way to get this information, but a work-around is to change SWT versions. Some of them implement JavaScript's window.resizeTo automatically, and some of them do not.

Javascript PopUp Functionality

I spent hundreds of hours writing an HTML5 application.This application deals with multiple popups and I suddenly ran into a problem when managing them.
My main goal would be bring a blurred popup window to front by focusing it.I am wondering if this is possible in JavaScript.
If not, could I use java applet in order to gain more functionality on my popup windows. Could I perhaps embed Google V8’s engine in order to render my existing HTML5 code in this application?
when you open a window you create a reference to it. You can then use that reference to call focus() on.
var foo = window.open( /*params*/ );
foo.focus();

How to drag from browser area and deposit to the explorer area?

Sometime ago I was facing the problem the other way around: how to drag an item (folder/file) from an explorer window (be it windows explorer, linux nautilus etc.) to the browser window - that is, the drag starts in one application and ends in the browser. Since I had control over the browser, I was able to intercept the dragend event: the one which interested me.
Now, I want to do this from the browser to the file explorer application: much like when you drag an image from firefox and drop it in a folder.
My main problem is that while I can check when the drag event exited the browser window, I have no ideea how to get the location where the drag event finished.
My ideea is to create a signed java applet and somehow track the mouse movement on the desktop - but this seems a little more than overkill.
Any pointers on this?
According to your justification is is not simple, but it can be managed. There is class called DataFlavor. You had to use D&D mechanism introduce in java using Transferable objects and provide correct mime-types and corresponding conversion. The problem is which mime-type will be accepted by explorer. I hope this help.
You won't be able to do this with JavaScript. JS is sandboxed in the browser and can't interact with anything outside.

Categories