Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading PDF shows a grey screen only #27721

Closed
vladimiry opened this issue Feb 12, 2021 · 4 comments
Closed

Loading PDF shows a grey screen only #27721

vladimiry opened this issue Feb 12, 2021 · 4 comments

Comments

@vladimiry
Copy link

vladimiry commented Feb 12, 2021

  • Electron Version: v12.0.0-beta.25 (also tested different v12.0.0-beta versions - all affected)
  • Operating System: Linux (not tested on other systems)
  • Last Known Working Electron version: 11.2.3

Expected Behavior

The PDF content should be displayed.

Actual Behavior

Only the gray screen is displayed.

To Reproduce

Load any PDF file using browserWindowInstance.loadURL / browserWindowInstance.loadFile methods.

Main process code sample if needed:

const {app, BrowserWindow} = require("electron");

app.whenReady().then(() => {
  app.on("web-contents-created", (...[, webContents]) => {
    webContents.on("did-fail-load", (...[, errorCode, errorDescription, validatedURL, isMainFrame]) => {
      console.log({errorCode, errorDescription, validatedURL, isMainFrame});
    });
  });

  // loading via "loadURL" call also affected
  new BrowserWindow().loadFile("path-to-pdf-file.pdf");
});

Additional Information

Possibly similar to #22286. CC @nornagon.

@vladimiry
Copy link
Author

The did-fail-load event setup this way:

app.on("web-contents-created", (...[, webContents]) => {
  webContents.on("did-fail-load", (...[/* event */, errorCode, errorDescription, validatedURL, isMainFrame]) => {
    console.log({errorCode, errorDescription, validatedURL, isMainFrame});
  });
});

Gets triggered with the following data:

{
  errorCode: -6,
  errorDescription: 'ERR_FILE_NOT_FOUND',
  validatedURL: 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html',
  isMainFrame: true
}

@codebytere
Copy link
Member

@vladimiry that should be #27499 - i'll see that it gets back to v12.x

@nornagon
Copy link
Member

bisected to v12.0.0-nightly.20201026...v12.0.0-nightly.20201030, probably bf89237 is the cause.

@nornagon
Copy link
Member

ah @codebytere already fixed this. Can we close this out now?

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

No branches or pull requests

3 participants