mirror of
https://github.com/tcsenpai/Zundler.git
synced 2025-06-06 11:35:40 +00:00
Fix issues when mimetype is incorrectly determined
This caused tons of popups.
This commit is contained in:
parent
e207e2086f
commit
f667106a9c
@ -211,7 +211,10 @@ var loadVirtualPage = (function (path, get_params, anchor) {
|
||||
const data = file.data;
|
||||
window.globalContext.getParameters = get_params;
|
||||
|
||||
if (file.mime_type == 'text/html') {
|
||||
// libmagic doesn't properly recognize mimetype of HTMl files that start
|
||||
// with empty lines. It thinks it's javascript. So we also consider the
|
||||
// filename when determining the file type.
|
||||
if (file.mime_type == 'text/html' || path.toLowerCase().endsWith(".html")) {
|
||||
window.globalContext.current_path = path;
|
||||
window.globalContext.anchor = anchor;
|
||||
const html = prepare(data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user