diff --git a/scripts/pi-hole/js/queryads.js b/scripts/pi-hole/js/queryads.js index 30a15704..aeeec981 100644 --- a/scripts/pi-hole/js/queryads.js +++ b/scripts/pi-hole/js/queryads.js @@ -41,7 +41,7 @@ function quietfilter(ta,data) { if(lines[i].indexOf("results") !== -1 && lines[i].indexOf("0 results") === -1) { - var shortstring = lines[i].replace("::: /etc/pihole/","").replace("data: ",""); + var shortstring = lines[i].replace("::: /etc/pihole/",""); // Remove "(x results)" shortstring = shortstring.replace(/\(.*/,""); ta.append(shortstring+"\n"); @@ -62,17 +62,17 @@ function eventsource() { if(q.val() === "yes") { quiet = true; - exact = "exact"; + exact = "&exact"; } // IE does not support EventSource - load whole content at once if (typeof EventSource !== "function") { - httpGet(ta,quiet,"/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+"&"+exact); + httpGet(ta,quiet,"/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+exact+"&IE"); return; } var host = window.location.host; - var source = new EventSource("/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+"&"+exact); + var source = new EventSource("/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+exact); // Reset and show field ta.empty(); diff --git a/scripts/pi-hole/php/queryads.php b/scripts/pi-hole/php/queryads.php index 008faf25..4a345905 100644 --- a/scripts/pi-hole/php/queryads.php +++ b/scripts/pi-hole/php/queryads.php @@ -6,7 +6,10 @@ header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); function echoEvent($datatext) { - echo "data: ".implode("\ndata: ", explode("\n", $datatext))."\n\n"; + if(!isset($_GET["IE"])) + echo "data: ".implode("\ndata: ", explode("\n", $datatext))."\n\n"; + else + echo $datatext; } // Credit: http://stackoverflow.com/a/4694816/2087442