569762e235486d02f69f6e677789e774f0f057a2
max
  Fri Mar 7 14:14:40 2025 -0800
adding view conversions link to hgLiftOver results section, refs #20666

diff --git src/hg/js/utils.js src/hg/js/utils.js
index 3227988a365..330e6f7d41b 100644
--- src/hg/js/utils.js
+++ src/hg/js/utils.js
@@ -4611,15 +4611,35 @@
     var argStr = jQuery.param(urlVars);
     argStr = argStr.replace(/%20/g, "+");
 
     return {"baseUrl": baseUrl, "args": argStr, "urlVars": urlVars};
 }
 
 function saveHistory(obj, urlParts, replace) {
     /* Save an object to the web browser's history stack. When we visit the page for the
      * first time, we replace the basic state after we are done making the initial UI */
     if (replace) {
         history.replaceState(obj, "", urlParts.baseUrl + (urlParts.args.length !== 0 ? "?" + urlParts.args : ""));
     } else {
         history.pushState(obj, "", urlParts.baseUrl + (urlParts.args.length !== 0 ? "?" + urlParts.args : ""));
     }
 }
+
+function forceDisplayBedFile(url) {
+    var w = window.open('');
+    w.document.write('<a class="button" HREF="'+url+'" TARGET=_blank><button>Download File</button></a>&nbsp;');
+    w.document.write('<button id="closeWindowLink" HREF="#">Close Tab</button>');
+    w.onload = () => {
+      // Attach event listeners after the new window is loaded
+      w.document.getElementById('closeWindowLink').addEventListener('click', () => {
+        // Handle click event
+        w.close();
+      });
+    };
+    fetch(url).then(response => response.text()) // Read the response as text
+    .then(text => {
+       w.document.write('<pre>' + text + '</pre>'); // Display the content
+       w.document.close(); // Close the document to finish rendering
+    })
+    .catch(error => console.error('Error fetching BED file:', error));
+}
+