Skip to content

Implementation of CefDownloadHandler does not open PDF #515

Description

@dmuatdbh

Describe the bug
After updating from jcef 127.3.1 to jcef 132.3.1 my Implementation of CefDownloadHandler does not work anymore.
When debugging in onbeforeDownload() - Method I do not run into a breakpoint in that method.

To Reproduce
Steps to reproduce the behavior:

  1. Implement a very easy version of CefDownloadHandler
    private static class ClientDownloadListener implements CefDownloadHandler {
@Override
        public boolean onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem, String fileName,
                                     CefBeforeDownloadCallback callback) {
            String fullPath = downloadItem.getFullPath();
            callback.Continue(fullPath, !isSupportedMimeType(downloadItem));
            return true;
        }

        @Override
        public void onDownloadUpdated(CefBrowser browser, CefDownloadItem downloadItem,
                                      CefDownloadItemCallback callback) {
            if (!downloadItem.isComplete()) {
                return;
            }
            PdfDownloadHandler downloadHandler  = new PdfDownloadHandler();
            downloadHandler.openFile(downloadItem.getFullPath());            
        }
  1. Download > 1 PDF in your Web-Application
  2. The first PDF shows up.... any following pdf does not open anymore

Expected behavior
Any triggered PDF-Download should open the expected PDF

Versions (please complete the following information):

  • OS: Windows 10, 11
  • Java Version: OpenJDK 14
  • JCEF Version: 132.3.1

Additional context
With version 127.3.1 any triggered PDF Download worked fine and opened the PDF

I think that issue is related to #490

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions