diff --git a/searx/webapp1.py b/searx/webapp1.py index 5a48a53a8..4dbbf7a1f 100644 --- a/searx/webapp1.py +++ b/searx/webapp1.py @@ -1303,19 +1303,18 @@ function modal_open(url, num) iframe.attachEvent("onload", function() { resolve("success"); }); - } else { - iframe.onload = function() { - resolve("success"); - }; - } -if (iframe.attachEvent&&num=='pdf') { + } else if (iframe.attachEvent&&num=='pdf') { iframe.attachEvent("textlayerrendered", function() { resolve("success"); }); - } else { + } else if (num=='pdf'){ iframe.textlayerrendered = function() { resolve("success"); }; + }else{ + iframe.onload = function() { + resolve("success"); + }; } }); keytextres = []