Permalink
Browse files

Merge pull request #49 from jdlrobson/ImportingIssues

prevent exception throwing when importing in chrome
  • Loading branch information...
2 parents 6d6a221 + f7d1283 commit 5c9592ffa7772c7f23c1e46d1ad2e2f6eaae4c03 @martinbudden martinbudden committed Aug 31, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 js/Import.js
View
@@ -99,15 +99,19 @@ config.macros.importTiddlers.onFeedChange = function(e)
config.macros.importTiddlers.onBrowseChange = function(e)
{
var wizard = new Wizard(this);
+ var file = this.value;
if(this.files && this.files[0]) {
+ file = this.files[0].fileName;
try {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
+ if(typeof(netscape) !== "undefined") {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
+ }
} catch (ex) {
showException(ex);
}
}
var fileInput = wizard.getElement("txtPath");
- fileInput.value = config.macros.importTiddlers.getURLFromLocalPath(this.value);
+ fileInput.value = config.macros.importTiddlers.getURLFromLocalPath(file);
var serverType = wizard.getElement("selTypes");
serverType.value = "file";
return true;

0 comments on commit 5c9592f

Please sign in to comment.