(StringComparer.OrdinalIgnoreCase)
14 | {
15 | { ".323", "text/h323" },
16 | { ".3g2", "video/3gpp2" },
17 | { ".3gp", "video/3gpp" },
18 | { ".7z", "application/x-7z-compressed" },
19 | { ".aab", "application/x-authorware-bin" },
20 | { ".aac", "audio/aac" },
21 | { ".aam", "application/x-authorware-map" },
22 | { ".aas", "application/x-authorware-seg" },
23 | { ".abc", "text/vnd.abc" },
24 | { ".acgi", "text/html" },
25 | { ".acx", "application/internet-property-stream" },
26 | { ".afl", "video/animaflex" },
27 | { ".ai", "application/postscript" },
28 | { ".aif", "audio/aiff" },
29 | { ".aifc", "audio/aiff" },
30 | { ".aiff", "audio/aiff" },
31 | { ".aim", "application/x-aim" },
32 | { ".aip", "text/x-audiosoft-intra" },
33 | { ".ani", "application/x-navi-animation" },
34 | { ".aos", "application/x-nokia-9000-communicator-add-on-software" },
35 | { ".appcache", "text/cache-manifest" },
36 | { ".application", "application/x-ms-application" },
37 | { ".aps", "application/mime" },
38 | { ".art", "image/x-jg" },
39 | { ".asf", "video/x-ms-asf" },
40 | { ".asm", "text/x-asm" },
41 | { ".asp", "text/asp" },
42 | { ".asr", "video/x-ms-asf" },
43 | { ".asx", "application/x-mplayer2" },
44 | { ".atom", "application/atom+xml" },
45 | { ".au", "audio/x-au" },
46 | { ".avi", "video/avi" },
47 | { ".avs", "video/avs-video" },
48 | { ".axs", "application/olescript" },
49 | { ".azw", "application/vnd.amazon.ebook" },
50 | { ".bas", "text/plain" },
51 | { ".bcpio", "application/x-bcpio" },
52 | { ".bin", "application/octet-stream" },
53 | { ".bm", "image/bmp" },
54 | { ".bmp", "image/bmp" },
55 | { ".boo", "application/book" },
56 | { ".book", "application/book" },
57 | { ".boz", "application/x-bzip2" },
58 | { ".bsh", "application/x-bsh" },
59 | { ".bz2", "application/x-bzip2" },
60 | { ".bz", "application/x-bzip" },
61 | { ".cat", "application/vnd.ms-pki.seccat" },
62 | { ".ccad", "application/clariscad" },
63 | { ".cco", "application/x-cocoa" },
64 | { ".cc", "text/plain" },
65 | { ".cdf", "application/cdf" },
66 | { ".cer", "application/pkix-cert" },
67 | { ".cha", "application/x-chat" },
68 | { ".chat", "application/x-chat" },
69 | { ".chm", "application/vnd.ms-htmlhelp" },
70 | { ".class", "application/x-java-applet" },
71 | { ".clp", "application/x-msclip" },
72 | { ".cmx", "image/x-cmx" },
73 | { ".cod", "image/cis-cod" },
74 | { ".coffee", "text/x-coffeescript" },
75 | { ".conf", "text/plain" },
76 | { ".cpio", "application/x-cpio" },
77 | { ".cpp", "text/plain" },
78 | { ".cpt", "application/x-cpt" },
79 | { ".crd", "application/x-mscardfile" },
80 | { ".crl", "application/pkix-crl" },
81 | { ".crt", "application/pkix-cert" },
82 | { ".csh", "application/x-csh" },
83 | { ".css", "text/css" },
84 | { ".csv", "text/csv" },
85 | { ".cs", "text/plain" },
86 | { ".c", "text/plain" },
87 | { ".c++", "text/plain" },
88 | { ".cxx", "text/plain" },
89 | { ".dart", "application/dart" },
90 | { ".dcr", "application/x-director" },
91 | { ".deb", "application/x-deb" },
92 | { ".deepv", "application/x-deepv" },
93 | { ".def", "text/plain" },
94 | { ".deploy", "application/octet-stream" },
95 | { ".der", "application/x-x509-ca-cert" },
96 | { ".dib", "image/bmp" },
97 | { ".dif", "video/x-dv" },
98 | { ".dir", "application/x-director" },
99 | { ".disco", "text/xml" },
100 | { ".dll", "application/x-msdownload" },
101 | { ".dl", "video/dl" },
102 | { ".doc", "application/msword" },
103 | { ".docm", "application/vnd.ms-word.document.macroEnabled.12" },
104 | { ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document" },
105 | { ".dot", "application/msword" },
106 | { ".dotm", "application/vnd.ms-word.template.macroEnabled.12" },
107 | { ".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template" },
108 | { ".dp", "application/commonground" },
109 | { ".drw", "application/drafting" },
110 | { ".dtd", "application/xml-dtd" },
111 | { ".dvi", "application/x-dvi" },
112 | { ".dv", "video/x-dv" },
113 | { ".dwg", "application/acad" },
114 | { ".dxf", "application/dxf" },
115 | { ".dxr", "application/x-director" },
116 | { ".el", "text/x-script.elisp" },
117 | { ".elc", "application/x-elc" },
118 | { ".emf", "image/emf" },
119 | { ".eml", "message/rfc822" },
120 | { ".eot", "application/vnd.bw-fontobject" },
121 | { ".eps", "application/postscript" },
122 | { ".epub", "application/epub+zip" },
123 | { ".es", "application/x-esrehber" },
124 | { ".etx", "text/x-setext" },
125 | { ".evy", "application/envoy" },
126 | { ".exe", "application/octet-stream" },
127 | { ".f77", "text/plain" },
128 | { ".f90", "text/plain" },
129 | { ".fdf", "application/vnd.fdf" },
130 | { ".fif", "image/fif" },
131 | { ".flac", "audio/x-flac" },
132 | { ".fli", "video/fli" },
133 | { ".flx", "text/vnd.fmi.flexstor" },
134 | { ".fmf", "video/x-atomic3d-feature" },
135 | { ".for", "text/plain" },
136 | { ".fpx", "image/vnd.fpx" },
137 | { ".frl", "application/freeloader" },
138 | { ".fsx", "application/fsharp-script" },
139 | { ".g3", "image/g3fax" },
140 | { ".gif", "image/gif" },
141 | { ".gl", "video/gl" },
142 | { ".gsd", "audio/x-gsm" },
143 | { ".gsm", "audio/x-gsm" },
144 | { ".gsp", "application/x-gsp" },
145 | { ".gss", "application/x-gss" },
146 | { ".gtar", "application/x-gtar" },
147 | { ".g", "text/plain" },
148 | { ".gz", "application/x-gzip" },
149 | { ".gzip", "application/x-gzip" },
150 | { ".hdf", "application/x-hdf" },
151 | { ".help", "application/x-helpfile" },
152 | { ".hgl", "application/vnd.hp-HPGL" },
153 | { ".hh", "text/plain" },
154 | { ".hlb", "text/x-script" },
155 | { ".hlp", "application/x-helpfile" },
156 | { ".hpg", "application/vnd.hp-HPGL" },
157 | { ".hpgl", "application/vnd.hp-HPGL" },
158 | { ".hqx", "application/binhex" },
159 | { ".hta", "application/hta" },
160 | { ".htc", "text/x-component" },
161 | { ".h", "text/plain" },
162 | { ".htmls", "text/html" },
163 | { ".html", "text/html" },
164 | { ".htm", "text/html" },
165 | { ".htt", "text/webviewhtml" },
166 | { ".htx", "text/html" },
167 | { ".ico", "image/vnd.microsoft.icon" },
168 | { ".ics", "text/calendar" },
169 | { ".idc", "text/plain" },
170 | { ".ief", "image/ief" },
171 | { ".iefs", "image/ief" },
172 | { ".iges", "model/iges" },
173 | { ".igs", "model/iges" },
174 | { ".iii", "application/x-iphone" },
175 | { ".ima", "application/x-ima" },
176 | { ".imap", "application/x-httpd-imap" },
177 | { ".inf", "application/inf" },
178 | { ".ins", "application/x-internett-signup" },
179 | { ".ip", "application/x-ip2" },
180 | { ".isp", "application/x-internet-signup" },
181 | { ".isu", "video/x-isvideo" },
182 | { ".it", "audio/it" },
183 | { ".iv", "application/x-inventor" },
184 | { ".ivf", "video/x-ivf" },
185 | { ".ivy", "application/x-livescreen" },
186 | { ".jam", "audio/x-jam" },
187 | { ".jar", "application/java-archive" },
188 | { ".java", "text/plain" },
189 | { ".jav", "text/plain" },
190 | { ".jcm", "application/x-java-commerce" },
191 | { ".jfif", "image/jpeg" },
192 | { ".jfif-tbnl", "image/jpeg" },
193 | { ".jpeg", "image/jpeg" },
194 | { ".jpe", "image/jpeg" },
195 | { ".jpg", "image/jpeg" },
196 | { ".jps", "image/x-jps" },
197 | { ".js", "text/javascript" },
198 | { ".json", "application/json" },
199 | { ".jsonld", "application/ld+json" },
200 | { ".jut", "image/jutvision" },
201 | { ".kar", "audio/midi" },
202 | { ".ksh", "text/x-script.ksh" },
203 | { ".la", "audio/nspaudio" },
204 | { ".lam", "audio/x-liveaudio" },
205 | { ".latex", "application/x-latex" },
206 | { ".list", "text/plain" },
207 | { ".lma", "audio/nspaudio" },
208 | { ".log", "text/plain" },
209 | { ".lsp", "application/x-lisp" },
210 | { ".lst", "text/plain" },
211 | { ".lsx", "text/x-la-asf" },
212 | { ".ltx", "application/x-latex" },
213 | { ".m13", "application/x-msmediaview" },
214 | { ".m14", "application/x-msmediaview" },
215 | { ".m1v", "video/mpeg" },
216 | { ".m2a", "audio/mpeg" },
217 | { ".m2v", "video/mpeg" },
218 | { ".m3u", "audio/x-mpequrl" },
219 | { ".m4a", "audio/mp4" },
220 | { ".m4v", "video/mp4" },
221 | { ".man", "application/x-troff-man" },
222 | { ".manifest", "application/x-ms-manifest" },
223 | { ".map", "application/x-navimap" },
224 | { ".mar", "text/plain" },
225 | { ".markdown", "text/markdown" },
226 | { ".mbd", "application/mbedlet" },
227 | { ".mc$", "application/x-magic-cap-package-1.0" },
228 | { ".mcd", "application/mcad" },
229 | { ".mcf", "image/vasa" },
230 | { ".mcp", "application/netmc" },
231 | { ".md", "text/markdown" },
232 | { ".mdb", "application/x-msaccess" },
233 | { ".mesh", "model/mesh" },
234 | { ".me", "application/x-troff-me" },
235 | { ".mid", "audio/midi" },
236 | { ".midi", "audio/midi" },
237 | { ".mif", "application/x-mif" },
238 | { ".mjf", "audio/x-vnd.AudioExplosion.MjuiceMediaFile" },
239 | { ".mjpg", "video/x-motion-jpeg" },
240 | { ".mjs", "text/javascript" },
241 | { ".mkv", "video/x-matroska" },
242 | { ".mm", "application/base64" },
243 | { ".mme", "application/base64" },
244 | { ".mny", "application/x-msmoney" },
245 | { ".mod", "audio/mod" },
246 | { ".mov", "video/quicktime" },
247 | { ".movie", "video/x-sgi-movie" },
248 | { ".mp2", "video/mpeg" },
249 | { ".mp3", "audio/mpeg" },
250 | { ".mp4", "video/mp4" },
251 | { ".mp4a", "audio/mp4" },
252 | { ".mp4v", "video/mp4" },
253 | { ".mpa", "audio/mpeg" },
254 | { ".mpc", "application/x-project" },
255 | { ".mpeg", "video/mpeg" },
256 | { ".mpe", "video/mpeg" },
257 | { ".mpga", "audio/mpeg" },
258 | { ".mpg", "video/mpeg" },
259 | { ".mpp", "application/vnd.ms-project" },
260 | { ".mpt", "application/x-project" },
261 | { ".mpv2", "video/mpeg" },
262 | { ".mpv", "application/x-project" },
263 | { ".mpx", "application/x-project" },
264 | { ".mrc", "application/marc" },
265 | { ".ms", "application/x-troff-ms" },
266 | { ".msg", "application/vnd.ms-outlook" },
267 | { ".msh", "model/mesh" },
268 | { ".m", "text/plain" },
269 | { ".mvb", "application/x-msmediaview" },
270 | { ".mv", "video/x-sgi-movie" },
271 | { ".mzz", "application/x-vnd.AudioExplosion.mzz" },
272 | { ".nap", "image/naplps" },
273 | { ".naplps", "image/naplps" },
274 | { ".nc", "application/x-netcdf" },
275 | { ".ncm", "application/vnd.nokia.configuration-message" },
276 | { ".niff", "image/x-niff" },
277 | { ".nif", "image/x-niff" },
278 | { ".nix", "application/x-mix-transfer" },
279 | { ".nsc", "application/x-conference" },
280 | { ".nvd", "application/x-navidoc" },
281 | { ".nws", "message/rfc822" },
282 | { ".oda", "application/oda" },
283 | { ".odp", "application/vnd.oasis.opendocument.presentation" },
284 | { ".ods", "application/vnd.oasis.opendocument.spreadsheet" },
285 | { ".odt", "application/vnd.oasis.opendocument.text" },
286 | { ".oga", "audio/ogg" },
287 | { ".ogg", "audio/ogg" },
288 | { ".ogv", "video/ogg" },
289 | { ".ogx", "application/ogg" },
290 | { ".omc", "application/x-omc" },
291 | { ".omcd", "application/x-omcdatamaker" },
292 | { ".omcr", "application/x-omcregerator" },
293 | { ".opus", "audio/opus" },
294 | { ".otf", "font/otf" },
295 | { ".oxps", "application/oxps" },
296 | { ".p10", "application/pkcs10" },
297 | { ".p12", "application/pkcs-12" },
298 | { ".p7a", "application/x-pkcs7-signature" },
299 | { ".p7b", "application/x-pkcs7-certificates" },
300 | { ".p7c", "application/pkcs7-mime" },
301 | { ".p7m", "application/pkcs7-mime" },
302 | { ".p7r", "application/x-pkcs7-certreqresp" },
303 | { ".p7s", "application/pkcs7-signature" },
304 | { ".part", "application/pro_eng" },
305 | { ".pas", "text/pascal" },
306 | { ".pbm", "image/x-portable-bitmap" },
307 | { ".pcl", "application/x-pcl" },
308 | { ".pct", "image/x-pict" },
309 | { ".pcx", "image/x-pcx" },
310 | { ".pdf", "application/pdf" },
311 | { ".pfx", "application/x-pkcs12" },
312 | { ".pgm", "image/x-portable-graymap" },
313 | { ".pic", "image/pict" },
314 | { ".pict", "image/pict" },
315 | { ".pkg", "application/x-newton-compatible-pkg" },
316 | { ".pko", "application/vnd.ms-pki.pko" },
317 | { ".pl", "text/plain" },
318 | { ".plx", "application/x-PiXCLscript" },
319 | { ".pm4", "application/x-pagemaker" },
320 | { ".pm5", "application/x-pagemaker" },
321 | { ".pma", "application/x-perfmon" },
322 | { ".pmc", "application/x-perfmon" },
323 | { ".pm", "image/x-xpixmap" },
324 | { ".pml", "application/x-perfmon" },
325 | { ".pmr", "application/x-perfmon" },
326 | { ".pmw", "application/x-perfmon" },
327 | { ".png", "image/png" },
328 | { ".pnm", "application/x-portable-anymap" },
329 | { ".pot", "application/vnd.ms-powerpoint" },
330 | { ".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12" },
331 | { ".potx", "application/vnd.openxmlformats-officedocument.presentationml.template" },
332 | { ".pov", "model/x-pov" },
333 | { ".ppa", "application/vnd.ms-powerpoint" },
334 | { ".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12" },
335 | { ".ppm", "image/x-portable-pixmap" },
336 | { ".pps", "application/vnd.ms-powerpoint" },
337 | { ".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12" },
338 | { ".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow" },
339 | { ".ppt", "application/vnd.ms-powerpoint" },
340 | { ".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12" },
341 | { ".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation" },
342 | { ".ppz", "application/mspowerpoint" },
343 | { ".pre", "application/x-freelance" },
344 | { ".prf", "application/pics-rules" },
345 | { ".prt", "application/pro_eng" },
346 | { ".ps", "application/postscript" },
347 | { ".p", "text/x-pascal" },
348 | { ".pub", "application/x-mspublisher" },
349 | { ".pwz", "application/vnd.ms-powerpoint" },
350 | { ".pyc", "application/x-bytecode.python" },
351 | { ".py", "text/x-script.phyton" },
352 | { ".qcp", "audio/vnd.qcelp" },
353 | { ".qif", "image/x-quicktime" },
354 | { ".qtc", "video/x-qtc" },
355 | { ".qtif", "image/x-quicktime" },
356 | { ".qti", "image/x-quicktime" },
357 | { ".qt", "video/quicktime" },
358 | { ".ra", "audio/x-pn-realaudio" },
359 | { ".ram", "audio/x-pn-realaudio" },
360 | { ".rar", "application/vnd.rar" },
361 | { ".ras", "application/x-cmu-raster" },
362 | { ".rast", "image/cmu-raster" },
363 | { ".rexx", "text/x-script.rexx" },
364 | { ".rf", "image/vnd.rn-realflash" },
365 | { ".rgb", "image/x-rgb" },
366 | { ".rm", "application/vnd.rn-realmedia" },
367 | { ".rmi", "audio/mid" },
368 | { ".rmm", "audio/x-pn-realaudio" },
369 | { ".rmp", "audio/x-pn-realaudio" },
370 | { ".rng", "application/ringing-tones" },
371 | { ".rnx", "application/vnd.rn-realplayer" },
372 | { ".roff", "application/x-troff" },
373 | { ".rp", "image/vnd.rn-realpix" },
374 | { ".rpm", "audio/x-pn-realaudio-plugin" },
375 | { ".rss", "application/rss+xml" },
376 | { ".rtf", "text/rtf" },
377 | { ".rt", "text/richtext" },
378 | { ".rtx", "text/richtext" },
379 | { ".rv", "video/vnd.rn-realvideo" },
380 | { ".s3m", "audio/s3m" },
381 | { ".sbk", "application/x-tbook" },
382 | { ".scd", "application/x-msschedule" },
383 | { ".scm", "application/x-lotusscreencam" },
384 | { ".sct", "text/scriptlet" },
385 | { ".sdml", "text/plain" },
386 | { ".sdp", "application/sdp" },
387 | { ".sdr", "application/sounder" },
388 | { ".sea", "application/sea" },
389 | { ".set", "application/set" },
390 | { ".setpay", "application/set-payment-initiation" },
391 | { ".setreg", "application/set-registration-initiation" },
392 | { ".sgml", "text/sgml" },
393 | { ".sgm", "text/sgml" },
394 | { ".shar", "application/x-bsh" },
395 | { ".sh", "text/x-script.sh" },
396 | { ".shtml", "text/html" },
397 | { ".sid", "audio/x-psid" },
398 | { ".silo", "model/mesh" },
399 | { ".sit", "application/x-sit" },
400 | { ".skd", "application/x-koan" },
401 | { ".skm", "application/x-koan" },
402 | { ".skp", "application/x-koan" },
403 | { ".skt", "application/x-koan" },
404 | { ".sl", "application/x-seelogo" },
405 | { ".smi", "application/smil" },
406 | { ".smil", "application/smil" },
407 | { ".snd", "audio/basic" },
408 | { ".sol", "application/solids" },
409 | { ".spc", "application/x-pkcs7-certificates" },
410 | { ".spl", "application/futuresplash" },
411 | { ".spr", "application/x-sprite" },
412 | { ".sprite", "application/x-sprite" },
413 | { ".spx", "audio/ogg" },
414 | { ".src", "application/x-wais-source" },
415 | { ".ssi", "text/x-server-parsed-html" },
416 | { ".ssm", "application/streamingmedia" },
417 | { ".sst", "application/vnd.ms-pki.certstore" },
418 | { ".step", "application/step" },
419 | { ".s", "text/x-asm" },
420 | { ".stl", "application/sla" },
421 | { ".stm", "text/html" },
422 | { ".stp", "application/step" },
423 | { ".sv4cpio", "application/x-sv4cpio" },
424 | { ".sv4crc", "application/x-sv4crc" },
425 | { ".svf", "image/x-dwg" },
426 | { ".svg", "image/svg+xml" },
427 | { ".svr", "application/x-world" },
428 | { ".swf", "application/x-shockwave-flash" },
429 | { ".talk", "text/x-speech" },
430 | { ".t", "application/x-troff" },
431 | { ".tar", "application/x-tar" },
432 | { ".tbk", "application/toolbook" },
433 | { ".tcl", "text/x-script.tcl" },
434 | { ".tcsh", "text/x-script.tcsh" },
435 | { ".tex", "application/x-tex" },
436 | { ".texi", "application/x-texinfo" },
437 | { ".texinfo", "application/x-texinfo" },
438 | { ".text", "text/plain" },
439 | { ".tgz", "application/x-compressed" },
440 | { ".tiff", "image/tiff" },
441 | { ".tif", "image/tiff" },
442 | { ".tr", "application/x-troff" },
443 | { ".trm", "application/x-msterminal" },
444 | { ".ts", "application/typescript" },
445 | { ".tsi", "audio/tsp-audio" },
446 | { ".tsp", "audio/tsplayer" },
447 | { ".tsv", "text/tab-separated-values" },
448 | { ".ttc", "font/collection" },
449 | { ".ttf", "font/ttf" },
450 | { ".txt", "text/plain" },
451 | { ".uil", "text/x-uil" },
452 | { ".uls", "text/iuls" },
453 | { ".unis", "text/uri-list" },
454 | { ".uni", "text/uri-list" },
455 | { ".unv", "application/i-deas" },
456 | { ".uris", "text/uri-list" },
457 | { ".uri", "text/uri-list" },
458 | { ".ustar", "multipart/x-ustar" },
459 | { ".uue", "text/x-uuencode" },
460 | { ".uu", "text/x-uuencode" },
461 | { ".vcd", "application/x-cdlink" },
462 | { ".vcf", "text/vcard" },
463 | { ".vcard", "text/vcard" },
464 | { ".vcs", "text/x-vcalendar" },
465 | { ".vda", "application/vda" },
466 | { ".vdo", "video/vdo" },
467 | { ".vew", "application/groupwise" },
468 | { ".vivo", "video/vnd.vivo" },
469 | { ".viv", "video/vnd.vivo" },
470 | { ".vmd", "application/vocaltec-media-desc" },
471 | { ".vmf", "application/vocaltec-media-file" },
472 | { ".voc", "audio/voc" },
473 | { ".vos", "video/vosaic" },
474 | { ".vox", "audio/voxware" },
475 | { ".vqe", "audio/x-twinvq-plugin" },
476 | { ".vqf", "audio/x-twinvq" },
477 | { ".vql", "audio/x-twinvq-plugin" },
478 | { ".vrml", "application/x-vrml" },
479 | { ".vsd", "application/x-visio" },
480 | { ".vst", "application/x-visio" },
481 | { ".vsw", "application/x-visio" },
482 | { ".w60", "application/wordperfect6.0" },
483 | { ".w61", "application/wordperfect6.1" },
484 | { ".w6w", "application/msword" },
485 | { ".wav", "audio/wav" },
486 | { ".wb1", "application/x-qpro" },
487 | { ".wbmp", "image/vnd.wap.wbmp" },
488 | { ".wcm", "application/vnd.ms-works" },
489 | { ".wdb", "application/vnd.ms-works" },
490 | { ".web", "application/vnd.xara" },
491 | { ".weba", "audio/webm" },
492 | { ".webm", "video/webm" },
493 | { ".webp", "image/webp" },
494 | { ".wiz", "application/msword" },
495 | { ".wk1", "application/x-123" },
496 | { ".wks", "application/vnd.ms-works" },
497 | { ".wmf", "image/wmf" },
498 | { ".wmlc", "application/vnd.wap.wmlc" },
499 | { ".wmlsc", "application/vnd.wap.wmlscriptc" },
500 | { ".wmls", "text/vnd.wap.wmlscript" },
501 | { ".wml", "text/vnd.wap.wml" },
502 | { ".wmp", "video/x-ms-wmp" },
503 | { ".wmv", "video/x-ms-wmv" },
504 | { ".wmx", "video/x-ms-wmx" },
505 | { ".woff", "font/woff" },
506 | { ".woff2", "font/woff2" },
507 | { ".word", "application/msword" },
508 | { ".wp5", "application/wordperfect" },
509 | { ".wp6", "application/wordperfect" },
510 | { ".wp", "application/wordperfect" },
511 | { ".wpd", "application/wordperfect" },
512 | { ".wps", "application/vnd.ms-works" },
513 | { ".wq1", "application/x-lotus" },
514 | { ".wri", "application/mswrite" },
515 | { ".wrl", "application/x-world" },
516 | { ".wrz", "model/vrml" },
517 | { ".wsc", "text/scriplet" },
518 | { ".wsdl", "text/xml" },
519 | { ".wsrc", "application/x-wais-source" },
520 | { ".wtk", "application/x-wintalk" },
521 | { ".wvx", "video/x-ms-wvx" },
522 | { ".x3d", "model/x3d+xml" },
523 | { ".x3db", "model/x3d+fastinfoset" },
524 | { ".x3dv", "model/x3d-vrml" },
525 | { ".xaml", "application/xaml+xml" },
526 | { ".xap", "application/x-silverlight-app" },
527 | { ".xbap", "application/x-ms-xbap" },
528 | { ".xbm", "image/x-xbitmap" },
529 | { ".xdr", "video/x-amt-demorun" },
530 | { ".xht", "application/xhtml+xml" },
531 | { ".xhtml", "application/xhtml+xml" },
532 | { ".xif", "image/vnd.xiff" },
533 | { ".xla", "application/vnd.ms-excel" },
534 | { ".xlam", "application/vnd.ms-excel.addin.macroEnabled.12" },
535 | { ".xl", "application/excel" },
536 | { ".xlb", "application/excel" },
537 | { ".xlc", "application/excel" },
538 | { ".xld", "application/excel" },
539 | { ".xlk", "application/excel" },
540 | { ".xll", "application/excel" },
541 | { ".xlm", "application/excel" },
542 | { ".xls", "application/vnd.ms-excel" },
543 | { ".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12" },
544 | { ".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12" },
545 | { ".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" },
546 | { ".xlt", "application/vnd.ms-excel" },
547 | { ".xltm", "application/vnd.ms-excel.template.macroEnabled.12" },
548 | { ".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template" },
549 | { ".xlv", "application/excel" },
550 | { ".xlw", "application/excel" },
551 | { ".xm", "audio/xm" },
552 | { ".xml", "text/xml" },
553 | { ".xpi", "application/x-xpinstall" },
554 | { ".xpix", "application/x-vnd.ls-xpix" },
555 | { ".xpm", "image/xpm" },
556 | { ".xps", "application/vnd.ms-xpsdocument" },
557 | { ".x-png", "image/png" },
558 | { ".xsd", "text/xml" },
559 | { ".xsl", "text/xml" },
560 | { ".xslt", "text/xml" },
561 | { ".xsr", "video/x-amt-showrun" },
562 | { ".xwd", "image/x-xwd" },
563 | { ".z", "application/x-compressed" },
564 | { ".zip", "application/zip" },
565 | { ".zsh", "text/x-script.zsh" }
566 | };
567 |
568 | public static string OctetStream => "application/octet-stream";
569 |
570 | public static bool TryGetMimeType(string filename,
571 | #if NET481
572 | #else
573 | [NotNullWhen(true)]
574 | #endif
575 |
576 | out string? mimeType)
577 | {
578 | string? extension = Path.GetExtension(filename);
579 |
580 | return Extensions.TryGetValue(filename, out mimeType);
581 | }
582 | }
583 | }
584 |
--------------------------------------------------------------------------------
/AnyWebApp/Utils/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AnyWebApp.Utils
9 | {
10 | public static class NativeMethods
11 | {
12 | public enum DwmWindowAttribute : uint
13 | {
14 | NCRenderingEnabled = 1,
15 | NCRenderingPolicy,
16 | TransitionsForceDisabled,
17 | AllowNCPaint,
18 | CaptionButtonBounds,
19 | NonClientRtlLayout,
20 | ForceIconicRepresentation,
21 | Flip3DPolicy,
22 | ExtendedFrameBounds,
23 | HasIconicBitmap,
24 | DisallowPeek,
25 | ExcludedFromPeek,
26 | Cloak,
27 | Cloaked,
28 | FreezeRepresentation,
29 | PassiveUpdateMode,
30 | UseHostBackdropBrush,
31 | UseImmersiveDarkMode = 20,
32 | WindowCornerPreference = 33,
33 | BorderColor,
34 | CaptionColor,
35 | TextColor,
36 | VisibleFrameBorderThickness,
37 | SystemBackdropType,
38 | Last
39 | }
40 |
41 | [DllImport("dwmapi.dll", PreserveSig = true)]
42 | public static extern int DwmSetWindowAttribute(nint hwnd, DwmWindowAttribute attr, ref int attrValue, int attrSize);
43 |
44 | public static bool EnableDarkModeForWindow(nint hWnd, bool enable)
45 | {
46 | int darkMode = enable ? 1 : 0;
47 | int hr = DwmSetWindowAttribute(hWnd, DwmWindowAttribute.UseImmersiveDarkMode, ref darkMode, sizeof(int));
48 | return hr >= 0;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/AnyWebApp/Utils/SystemHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using Microsoft.Win32;
8 |
9 | namespace AnyWebApp.Utils
10 | {
11 | public static class SystemHelper
12 | {
13 | private static bool? IsDarkThemeDependOnRegistry()
14 | {
15 | const string RegistryKeyPath = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
16 | const string RegistryValueName = "AppsUseLightTheme";
17 | // 这里也可能是LocalMachine(HKEY_LOCAL_MACHINE)
18 | // see "https://www.addictivetips.com/windows-tips/how-to-enable-the-dark-theme-in-windows-10/"
19 | object? registryValueObject = Registry.CurrentUser.OpenSubKey(RegistryKeyPath)?.GetValue(RegistryValueName);
20 | if (registryValueObject is null)
21 | return null;
22 | return (int)registryValueObject > 0 ? false : true;
23 | }
24 |
25 | public static bool IsDarkTheme()
26 | {
27 | return IsDarkThemeDependOnRegistry() ?? false;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/AnyWebApp/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
54 |
55 |
56 |
57 | true
58 | true
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/AnyWebApp/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlimeNull/AnyWebApp/b35a8b695daa751acf4d4add134cf137dc51a75e/AnyWebApp/icon.ico
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 SlimeNull
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 
5 |
6 | # AnyWebApp
7 |
8 | _✨ Run any web app without hosting a web server! ✨_
9 |
10 | [](README.zh.md)
11 | [](/LICENSE)
12 | 
13 |
14 |
15 |
16 |
17 | ---
18 |
19 | You don't need to install anything, write any scripts, or do any complex configuration.
20 | Just follow these steps to run your web application as a desktop application on Windows.
21 |
22 | ## Preview
23 |
24 | This simple app was built with [vue](https://vuejs.org/) and [vuetify](https://vuetifyjs.com/), and it runs well on AnyWebApp
25 |
26 | 
27 |
28 |
29 | ## Usage
30 |
31 | 1. Download the latest release.
32 | 2. Create a folder `wwwroot` for storage your web app assets.
33 | 3. Copy all of your web app assets to the folder
34 | 4. Start `AnyWebApp.exe`
35 |
36 | ## Requirements
37 |
38 | - [Microsoft Edge WebView2 Runtime](https://learn.microsoft.com/en-us/microsoft-edge/webview2/)
39 |
40 | ## Confuguration
41 |
42 | After Starting `AnyWebApp.exe`, a config file named `AppConfig.json` will be generated.
43 |
44 | You can specify the root directory of the web application,
45 | the scheme used for requests, the default startup URI,
46 | the window title, icon, size, and scaling ratio, etc. in the configuration file.
47 |
48 |
49 | ## FAQ
50 |
51 | Below is the content about frequently asked questions and some usage tips.
52 |
53 | ### Configure for Vue Router
54 |
55 | If you are using Vue router and using 'history' mode, you can configure like this.
56 |
57 | 1. After Starting `AnyWebApp.exe`, a config file named `AppConfig.json` will be generated.
58 | 2. Open that config file, then set `EnableDocumentFallbackFiles` to `true`
59 |
60 | After completing these steps, when your program requests a non-existent document resource,
61 | it will return the document configured in the configuration file, such as `index.html`.
62 | This way, Vue Router can work in your web application.
--------------------------------------------------------------------------------
/README.zh.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | 
4 |
5 | # AnyWebApp
6 |
7 | _✨ 在没有托管 Web 服务器的情况下运行任何 Web 应用程序!✨_
8 |
9 |
10 | [](/LICENSE)
11 | [](/Releases)
12 |
13 |
14 |
15 |
16 | ---
17 |
18 | 您无需安装任何东西、编写任何脚本或进行任何复杂的配置。只需按照以下步骤,在 Windows 上运行您的 Web 应用程序作为桌面应用程序。
19 |
20 | ## 预览
21 |
22 | 此简单的应用程序是使用 [vue](https://vuejs.org/) 和 [vuetify](https://vuetifyjs.com/) 构建的,并且在 AnyWebApp 上运行良好。
23 |
24 | 
25 |
26 |
27 | ## 使用方法
28 |
29 | 1. 下载最新版本。
30 | 2. 创建一个名为 `wwwroot` 的文件夹,用于存储您的 Web 应用程序资产。
31 | 3. 将您的所有 Web 应用程序资产复制到该文件夹中。
32 | 4. 启动 `AnyWebApp.exe`
33 |
34 | ## 要求
35 |
36 | - [Microsoft Edge WebView2 Runtime](https://learn.microsoft.com/en-us/microsoft-edge/webview2/)
37 |
38 | ## 配置
39 |
40 | 启动 `AnyWebApp.exe` 后,将生成一个名为 `AppConfig.json` 的配置文件。
41 |
42 | 您可以在配置文件中指定 Web 应用程序的根目录、请求所使用的方案、默认启动 URI、窗口标题、图标、大小和缩放比率等。
43 |
44 | ## 常见问题解答
45 |
46 | 以下是关于常见问题和一些使用技巧的内容。
47 |
48 | ### 配置 Vue Router
49 |
50 | 如果您正在使用 Vue Router 并使用“history”模式,则可以进行如下配置。
51 |
52 | 1. 启动 `AnyWebApp.exe` 后,将生成一个名为 `AppConfig.json` 的配置文件。
53 | 2. 打开该配置文件,然后将 `EnableDocumentFallbackFiles` 设置为 `true`。
54 |
55 | 完成这些步骤后,当您的程序请求不存在的文档资源时,它将返回在配置文件中配置的文档,例如 `index.html`。这样,Vue Router 就可以在您的 Web 应用程序中工作了。
--------------------------------------------------------------------------------
/assets/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
60 |
61 |
62 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/assets/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlimeNull/AnyWebApp/b35a8b695daa751acf4d4add134cf137dc51a75e/assets/icon128.png
--------------------------------------------------------------------------------
/assets/icon256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlimeNull/AnyWebApp/b35a8b695daa751acf4d4add134cf137dc51a75e/assets/icon256.png
--------------------------------------------------------------------------------
/assets/icon512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlimeNull/AnyWebApp/b35a8b695daa751acf4d4add134cf137dc51a75e/assets/icon512.png
--------------------------------------------------------------------------------
/assets/icon64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlimeNull/AnyWebApp/b35a8b695daa751acf4d4add134cf137dc51a75e/assets/icon64.png
--------------------------------------------------------------------------------
/assets/preview1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlimeNull/AnyWebApp/b35a8b695daa751acf4d4add134cf137dc51a75e/assets/preview1.png
--------------------------------------------------------------------------------