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

Display local PDF with cmd switch "disable-site-isolation-trials" #26714

Closed
3 tasks done
simann opened this issue Nov 27, 2020 · 16 comments
Closed
3 tasks done

Display local PDF with cmd switch "disable-site-isolation-trials" #26714

simann opened this issue Nov 27, 2020 · 16 comments
Labels
10-x-y 11-x-y 12-x-y 13-x-y 14-x-y bug 🪲 component/pdf-viewer has-repro-gist Issue can be reproduced with code at https://gist.github.com/ stale status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@simann
Copy link

simann commented Nov 27, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 10.1.5
  • Operating System:
    • Windows 10 x64
  • Last Known Working Electron version:

Expected Behavior

Render a local PDF (PDF file in the app root) in a BrowserWindow with cmd switch 'disable-site-isolation-trials'

Actual Behavior

Opens a BrowserWindow but the PDF is not loaded and the window stays grey. Besides that there is no error message saying what went wrong.

To Reproduce

Minimal example to reproduce

#################main.js##############
const { app, BrowserWindow, session } = require('electron');
const { join } = require('path');

// uncomment this line to break the PDF Viewer
//app.commandLine.appendSwitch('disable-site-isolation-trials');
async function ready() {
  const mainWindow = new BrowserWindow({
    x: 0,
    y: 0,
    width: 800,
    height: 800,
    show: true,
  });
  mainWindow.loadURL(join("file://", __dirname, "main.html"));
}

app.whenReady().then(ready);

#################main.html##################
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
</head>
<body>
    <embed src="test.pdf" style="width:100%;height:400px">
</body>
</html>

Screenshots

With cmd switch "disable-site-isolation-trials"
pdf_not_working

Without cmd switch "disable-site-isolation-trials"
pdf_working

Additional Information

The PDf File "test.pdf" is in the root of my application.

Any help or hint would be appreciated :)

Greetings Simon

@asiercamara
Copy link

Same problem using "electron": "11.0.3"

@gdavidkov
Copy link

I have the same problem using the latest Electron 11.2.1. This issue is not observed in Chrome when it is started with --disable-site-isolation-trials.

@ckerr ckerr added 10-x-y 11-x-y bug 🪲 component/pdf-viewer has-repro-gist Issue can be reproduced with code at https://gist.github.com/ status/confirmed A maintainer reproduced the bug or agreed with the feature labels Jan 26, 2021
@ckerr
Copy link
Member

ckerr commented Jan 26, 2021

Gist form of @simann's testcase: https://gist.github.com/ckerr/7985be12498d49847bc2055723ecee1e

Tested on Ubuntu 20.10 with Electron 11.2.1. In that gist's package.json, start and start2 are the scripts to run to see the difference in whether the command-line switch is passed.

@m4heshd
Copy link

m4heshd commented May 17, 2021

The issue is still present in Electron v12.0.0.

@nornagon
Copy link
Member

nornagon commented Jul 8, 2021

Updated gist, since the previous one stopped working due to X-IFrame-Options: https://gist.github.com/c98992fbd090d8fbaf9077e30db6d846

I see this log message which might provide a clue:

11:28:35 AM [84778:0708/112835.836391:INFO:CONSOLE(6)] "Not allowed to load local resource: chrome://resources/css/text_defaults_md.css", source: chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html (6)

It seems to be because this method returns false when disable-site-isolation-trials is present, but true when not: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/weborigin/security_origin.cc;l=414;drc=f6c91c781cfb40a7a0f07a49ec3fcd5685d85423

@wzono
Copy link

wzono commented Sep 30, 2021

Any progress?

@phablulo
Copy link

phablulo commented Dec 17, 2021

The same issue is still present in versions 15-x-y and 16-x-y on a Ubuntu 20.04 machine.

@BishopOoma
Copy link

BishopOoma commented Apr 13, 2022

Same issue, on MacOS and it's preventing functionality in combination with issue #18214 (see Jitsi notes)

If we use disable-site-isolation-trials then Jitsi screen-sharing works but we lose the ability to display PDFs.
If we don't use disable-site-isolation-trials then we can display PDFs but Jitsi screen-sharing is broken.

Has anyone found a solution for this?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Oct 6, 2022
@deiucanta
Copy link

Bump

@BishopOoma
Copy link

bump

@github-actions github-actions bot removed the stale label Oct 7, 2022
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Jan 10, 2023
@deiucanta
Copy link

bump

@github-actions github-actions bot removed the stale label Jan 11, 2023
@biology-w
Copy link

bump

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Jun 23, 2023
@github-actions
Copy link
Contributor

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10-x-y 11-x-y 12-x-y 13-x-y 14-x-y bug 🪲 component/pdf-viewer has-repro-gist Issue can be reproduced with code at https://gist.github.com/ stale status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
None yet
Development

No branches or pull requests