Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracking user activity on window opened by window.open() method

I want to open a ftp browser at client site so that he can upload files in ftp. I am using window.open() method to open the ftp in a child window.

var windowObjectReference = window.open("ftp://" + username + ":" + password + "@" + server,
                                         _blank', toolbar=yes, location=yes, status=yes,
                                         scrollbars=auto, copyhistory=no, 
                                         menubar=yes, width= 500px, height=500px,
                                         left=300px), top=100px, resizable=yes' );

The ftp looks like this:

[1]: http://i.stack.imgur.com/T6WYg.jpg

now i want to track the user activity like directories he visited,and send the path to the jsp page how to do that...??

like image 700
monu dwivedi Avatar asked Dec 04 '14 07:12

monu dwivedi


People also ask

How do you check if a window is already open in JavaScript?

How to check if an opened browser window is closed or not in JavaScript? To check if an opened browser window is closed, you can use the closed property in referenced window object in JavaScript. The property returns a boolean true if the window is closed and false if the window is in the opened state.

Which of the following methods in JavaScript can be used to open a blank window named example with default features?

open() function contains the URL string of a webpage, which you want to open. If you do not specify any URL in this function, it will open a new blank window (about:blank).


1 Answers

For security reasons, browser windows with different domains can't see each other (same origin policy). On top of that, the ftp protocol doesn't support any kind of JavaScript which would allow you to track what the user does.

That leaves you with two options:

  1. Analyze the log files of the FTP server to see what the user did.
  2. Instead of redirecting to ftp:// directly, write a JSP which gives access to the files on the FTP server. That way, you can track anything that the user does.

For solution #2, the files need to be on the web server or you need to use a Java library which can talk to an FTP server.

Note: The FTP client in the browser is probably implemented using HTML and JavaScript but all this code is hidden somewhere in the browser. So even though the display is HTML and JavaScript, you can't access it.

like image 165
Aaron Digulla Avatar answered Oct 27 '22 15:10

Aaron Digulla