Skip to content

TagSpaces is an offline, open source, document manager with tagging support

mht files are now opened in a new window in chrome and node-webkit

uggrockce9105d21d9e
diff --git a/data/ext/viewerBrowser/extension.js b/data/ext/viewerBrowser/extension.js
index 27acc7c92..8e9fc5766 100644
--- a/data/ext/viewerBrowser/extension.js
+++ b/data/ext/viewerBrowser/extension.js
@@ -52,11 +52,10 @@ define(function(require, exports, module) {
})
);
TSCORE.IO.loadTextFile(filePath);
- } else if(fileExt.indexOf("mht") == 0 && isChrome) {
+ } else if(fileExt.indexOf("mht") == 0 && (isChrome || isNode)) {
$containerElement.append($('<button>', {
- //href: filePathURI,
- class: "btn btn-warning",
- //target: "_blank",
+ class: "btn btn-primary",
+ style: "margin: 5px;",
text: "Open in new window"
}).click(function() {
// if(isNode) {
@@ -64,6 +63,12 @@ define(function(require, exports, module) {
// }
})
);
+ $containerElement.append($('<div>', {
+ class: "alert alert-info",
+ style: "margin: 5px; font-size: 14px;",
+ text: "For security reasons, opening of MHT files in iframes has been disabled in Chrome, so to open this MHT file, press the button above. This issue will be solved soon, with a custom MHT viewer."
+ })
+ );
} else {
$containerElement.append($('<iframe>', {
// sandbox: "allow-same-origin allow-scripts", // comment out due not loading pdfs in chrome ext