Commits

ryanackley committed 76a1c73

Fix for bug #20 and tweaks to loading the NPAPI plugin

Comments (0)

Files changed (2)

ProjectManager.js

 			var dotIdx = localPath.lastIndexOf('.');
 			if (dotIdx != -1){
 				var ext = localPath.substring(dotIdx + 1);
-				if (ext == 'js' || ext == 'css' || ext == 'html' || ext == 'htm'){
+				if (watcher && (ext == 'js' || ext == 'css' || ext == 'html' || ext == 'htm')){
 					watcher.addChangedByMe(localPath);
 				}
 			}
     catch(e){
         console.log('Native file support failed to load, trying to reload...');
         if (nativeFileSupport){
-            nativeFileSupport.parentNode.removeChild(nativeFileSupport);
+            if (nativeFileSupport.parentNode){
+                nativeFileSupport.parentNode.removeChild(nativeFileSupport);
+            }
+            else{
+                document.head.removeChild(nativeFileSupport);
+            }
         }
         window.setTimeout(addNpapiTag, 0);
     }