Skip to content

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

adding button for opening of mhtml files in new tab in chrome

uggrock0a1cf177032f
diff --git a/data/ext/viewerBrowser/extension.js b/data/ext/viewerBrowser/extension.js
index 906774553..0a8d4fed9 100644
--- a/data/ext/viewerBrowser/extension.js
+++ b/data/ext/viewerBrowser/extension.js
@@ -52,8 +52,20 @@ define(function(require, exports, module) {
})
);
TSCORE.IO.loadTextFile(filePath);
+ } else if(fileExt.indexOf("mht") == 0 && isChrome) {
+ $containerElement.append($('<button>', {
+ //href: filePathURI,
+ class: "btn btn-warning",
+ //target: "_blank",
+ text: "Open in new window"
+ }).click(function() {
+ // if(isNode) {
+ window.open(filePathURI,'_blank');
+ // }
+ })
+ );
} else {
- $containerElement.append($('<iframe>', {
+ $containerElement.append($('<iframe>', {
sandbox: "allow-same-origin",
id: "iframeViewer",
src: filePathURI,