From 2064b69aeb7c62734890bfa780178f31056fbf93 Mon Sep 17 00:00:00 2001 From: Bentley Cook Date: Thu, 5 Sep 2024 15:05:24 -0500 Subject: [PATCH] Add .json files to filetypes opened in new tab --- open_in_new_tab/js/open_in_new_tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/open_in_new_tab/js/open_in_new_tab.js b/open_in_new_tab/js/open_in_new_tab.js index 964fb4c..56d786e 100644 --- a/open_in_new_tab/js/open_in_new_tab.js +++ b/open_in_new_tab/js/open_in_new_tab.js @@ -19,7 +19,7 @@ function pdf_new_window () } let links = document.getElementsByTagName("a"); for (let eleLink=0; eleLink < links.length; eleLink ++) { - if ((links[eleLink].href.indexOf('.pdf') !== -1)||(links[eleLink].href.indexOf('.doc') !== -1)||(links[eleLink].href.indexOf('.docx') !== -1)) { + if ((links[eleLink].href.indexOf('.pdf') !== -1)||(links[eleLink].href.indexOf('.doc') !== -1)||(links[eleLink].href.indexOf('.json') !== -1)||(links[eleLink].href.indexOf('.docx') !== -1)) { links[eleLink].onclick = function() { window.open(this.href); @@ -42,4 +42,4 @@ if (typeof document$ !== "undefined") { document$.subscribe(function() { apply_rules(); }) -} \ No newline at end of file +}