- summary: import uses NS bookmarks.html --> import users NS bookmarks.html
here is how anotehr site did it, doesnt work on moz though.
function doImport() {
if (opener == null) {
window.alert('This popup is being used in an invalid
state.');
return false;
}
window.onerror = handleError;
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileAccess");
var home = java.lang.System.getProperty("user.home");
if (navigator.userAgent.indexOf("Macintosh") != -1) {
var fileName = home + ":Bookmarks.html";
} else if (navigator.userAgent.indexOf("X11") == -1) {
var fileName = home +
java.lang.System.getProperty("file.separator") +
"bookmark.htm";
} else {
var fileName = home +
java.lang.System.getProperty("file.separator") +
"bookmark.html";
}
var inputStream = new java.io.FileInputStream(fileName);
var dataInputStream = new
java.io.DataInputStream(inputStream);
var data = "";
var line = "";
while ((line = dataInputStream.readLine()) != null) {
data += line + "\n";
}
inputStream.close();
opener.data = data;
window.alert("Import Successful!")
self.close();
opener.focus();
return false;
}