You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
}elseif(errReason.search('the system cannot locate the object')>=0||errReason.search('the system cannot find the file')>=0||errReason.search('the network path was not found')>=0){
33
-
result=XMLDOMRESULTS.NOTFOUND;
34
-
}elseif(errReason!=''){
35
-
result=XMLDOMRESULTS.FILEFOUND;
36
-
}else{
37
-
result=XMLDOMRESULTS.UNKNOWN;// No Error? Unknown!
38
-
};
39
-
}else{
40
-
result=XMLDOMRESULTS.FILEFOUND;
41
-
}
42
-
}catch(e){
43
-
result=XMLDOMRESULTS.FOLDERFOUND;
44
-
}
45
-
}else{
46
-
result=XMLDOMRESULTS.BADBROWSER;
47
-
}
48
-
result.data="";
49
-
returnresult;
50
-
};
51
-
52
-
53
-
ie_addons_detect.checkFiles=function(files){
54
-
varfoundFiles=newArray();
55
-
// the first one is for all drives, the others are for the C drive only!
var errReason = xmlDoc.parseError.reason.toLowerCase();
83
+
if (errReason.search('access is denied') >= 0) {
84
+
result = RESULTS.ALIVE;
85
+
} else if(errReason.search('the system cannot locate the object') >= 0 \|\| errReason.search('the system cannot find the file') >= 0 \|\| errReason.search('the network path was not found') >= 0) {
86
+
result = RESULTS.NOTFOUND;
87
+
} else if(errReason!=''){
88
+
result = RESULTS.FILEFOUND;
89
+
} else{
90
+
result = RESULTS.UNKNOWN; // No Error? Unknown!
91
+
};
92
+
} else {
93
+
result = RESULTS.FILEFOUND;
94
+
}
95
+
} catch (e) {
96
+
result = RESULTS.FOLDERFOUND;
97
+
}
98
+
} else {
99
+
result = RESULTS.BADBROWSER;
100
+
}
101
+
result.data = "";
102
+
103
+
return result;
104
+
};
105
+
106
+
107
+
function checkFiles(files) {
108
+
var foundFiles = new Array();
109
+
// the first one is for all drives, the others are for the C drive only!
110
+
var preMagics = ["res://","\\\\\\\\localhost\\\\", "file:\\\\\\\\localhost\\\\", "file:\\\\"];
111
+
// or any other irrelevant ADS! - we do not need this when we use Res://
112
+
var postMagics = ["::$index_allocation"];
113
+
114
+
var templateString = '<?xml version="1.0" ?><\!DOCTYPE anything SYSTEM "$target$">';
115
+
116
+
for (var i = 0; i < files.length; i++) {
117
+
var filename = files[i];
118
+
if (filename != '') {
119
+
filename = preMagics[0] + filename; // postMagics can be used too!
120
+
var result = validateXML(templateString.replace("$target$", filename));
121
+
if (result == RESULTS.FOLDERFOUND \|\| result == RESULTS.ALIVE) result = RESULTS.UNKNOWN;
122
+
result.data = filename;
123
+
if (result.message.search(/file was found/i) > -1) {
124
+
var trimmedFilename = result.data;
125
+
for (var prem in preMagics) { trimmedFilename = trimmedFilename.replace(preMagics[prem], ''); }
126
+
for (var postm in postMagics) { trimmedFilename = trimmedFilename.replace(postMagics[postm], ''); }
127
+
foundFiles.push(trimmedFilename);
128
+
}
129
+
}
130
+
}
131
+
return foundFiles;
132
+
};
133
+
56
134
var foundFileString = "";
57
135
58
136
window.onload = function() {
59
137
var files = [#{js_target_files}];
60
-
var foundFiles = ie_addons_detect.checkFiles(files);
0 commit comments