I don't know whether this is valid or not. I went through some links and tried many solutions but none of them are working.
I have a pdf with some links and then click on that link it has to open a new tab in the browser and do some functionality after that tab has to be closed automatically.
<a target="_blank" href="http://your_url_here.html">Link</a>
I updated the link in the PDF as like that and window.close() is completing the functionality.
It is perfectly working fine when we open the pdf from ADOBE or Foxit Reader or any other PDF reader. But the problem is all the latest browsers have the support to view the PDFs files in them. When the link is clicked, that's getting redirected on the same tab and the window.close() is throwing the below error.
"Scripts may close only the windows that were opened by it."
I am not exactly sure whether browser PDF viewers have the support or not. Can somebody help me with this problem or have any idea if this can be achieved?