quick and dirty close pdf viewer

If you close pdf viewer next pdf file doesn't open in viewer but gets downloaded. Because I can not find the call for showPDFviewer, in a first attempt I close it by refreshing the page.