views:

127

answers:

1

Hey there,

When I drag a file from the desktop to the browser, and I keep the browser in focus (Safari or FireFox for now), I know everything works right (dragging, having the app respond, etc.). I am also able to un-focus the browser, by clicking on my desktop for example (keeping the browser in view), and when I drag the file to the browser, I am still able to process the drag events, which is cool.

I'm just wondering how I can refocus the browser when:

1) It's not in focus, and 2) when it's not in focus, I drag something over it.

I can do something like window.focus(), but that doesn't bring the whole browser back into focus out of the things on my desktop. What line of js code do I need to make the browser refocus, like how when you drag a folder to an unfocused/blurred Finder window on the Mac and it pops into focus after a second or two?

Then it's onto processing the dragged info...

A: 

Javascript cannot access the browser like that and cannot control the operating system's focus which is what you are really asking for.

Ambrosia
makes sense. just wondering if it was possible. I'm still able to drag and drop without getting the browser into focus which is interesting...
viatropos