I am trying to replace window.open(file_path)
, which doesn't work satisfactorily in browser windows without toolbars (edge, chrome). With code using script clicking on anchor (simplified form SO:easiest way to open a download window without navigating away from the page)
var a = document.createElement('A');
a.href = file_path;
a.click();
The problem is that the original code has ability to detect that the window opening was blocked (popup blocker)
var wnd = window.open(docurl)
if (wnd != null) {/*...*/}
Is there a possibility detecting that the download was blocked for clicking on an anchor?