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

Sandbox inside ppapi don't inherit sanbox property from BrowserWindow #18516

Closed
3 tasks done
Feverqwe opened this issue May 30, 2019 · 10 comments
Closed
3 tasks done

Sandbox inside ppapi don't inherit sanbox property from BrowserWindow #18516

Feverqwe opened this issue May 30, 2019 · 10 comments

Comments

@Feverqwe
Copy link

Feverqwe commented May 30, 2019

Hello. I run BrowserWindow with sandbox false and when run ppapi plugin inside, it runing inside sandbox.

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:
    • 5.0.2
  • Operating System:
    • Windows 10 (1903)
  • Last Known Working Electron version:
    • 4.2.2

Expected Behavior

ppapi process must inheret --no-sandbox switch

Actual Behavior

ppapi process don't inheret --no-sandbox switch when BrowserWindow have sandbox: false property.

To Reproduce

Create window and run any ppapi plugin inside

new BrowserWindow({
      ...
      webPreferences: {
         sandbox: false
      }
    });

Additional Information

I can fix it with this switch, but is disable sandbox globally.

      electron.app.commandLine.appendSwitch('no-sandbox');
@miniak
Copy link
Contributor

miniak commented Jun 7, 2019

@Feverqwe Why is that a problem?

@Feverqwe
Copy link
Author

Feverqwe commented Jun 7, 2019

@miniak cause ppapi plugins don't works. I can't disable sandbox for window, I can only disable it globally.

@miniak
Copy link
Contributor

miniak commented Jun 15, 2019

@Feverqwe which plugin? The only plugins that would not work with sandbox are host-native ones built as plain DLL that don't exclusively use the Pepper API.

@Feverqwe
Copy link
Author

Feverqwe commented Jun 15, 2019

I use mpv.js from here https://github.com/Kagami/mpv.js
if I don't use no-sandbox switch I see black block.

@miniak
Copy link
Contributor

miniak commented Jun 22, 2019

@Feverqwe the proper solution IMO in this case is to add a new API to opt-out of sandboxing for a particular plugin. See PR #18939

@miniak
Copy link
Contributor

miniak commented Jun 22, 2019

code example would be

const {PLUGIN_MIME_TYPE} = require("mpv.js");
app.disablePluginSandbox(PLUGIN_MIME_TYPE);

@Feverqwe
Copy link
Author

Its looks great! Thx!

@miniak
Copy link
Contributor

miniak commented Jun 22, 2019

@Feverqwe the only problem is that this is semver minor and we'll be only able to add this to Electron 6, which is still in beta. For Electron 5, we would have to bump 5.0 to 5.1 in order to add a new API there.

@Feverqwe
Copy link
Author

@miniak its not a problem for me. I resolve this problem via switch, after release I will use this api method.

@electron-triage
Copy link

Closing this issue as it is reported to be fixed. Feel free to reach out if you are still experiencing this issue in later versions of Electron and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
5.0.x
Unsorted Issues
Development

No branches or pull requests

4 participants