Skip to content

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

correcting opening external files

uggrock3e815bc675c8
diff --git a/data/js/ext.api.js b/data/js/ext.api.js
index ee3610ff6..bf9664023 100644
--- a/data/js/ext.api.js
+++ b/data/js/ext.api.js
@@ -21,11 +21,16 @@ define(function(require, exports, module) {
}
}
- function openLinkExternally(url) {
- if (url.indexOf("http://") === 0 || url.indexOf("https://") === 0 || url.indexOf("file://") === 0) {
- TSCORE.openLinkExternally(url);
+ function openLinkExternally(uri) {
+ uri = decodeURIComponent(uri);
+ if (
+ uri.indexOf("http://") === 0 ||
+ uri.indexOf("https://") === 0 ||
+ uri.indexOf("file://") === 0
+ ) {
+ TSCORE.openLinkExternally(uri);
} else {
- console.log("Not supported URL format: " + url);
+ console.log("Not supported URL format: " + uri);
}
}