Launch CEF3 w/ Unsandboxed Plugin Access allowed

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Launch CEF3 w/ Unsandboxed Plugin Access allowed

Postby AltamishM » Mon Nov 05, 2018 2:28 am

Hi, Folks

My team has embedded CEF3 (ver.66) and circumvented the sandbox warning dialog.

We still require the browser to "Ask" for the user to allow "Unsandboxed plugin access", or to "Allow" by default, instead if "Blocking", which is what it currently does.

Usually, such a setting is accessed via the site's settings page in browsers like Google Chrome:

Image

However, we cannot facilitate this in our framework and would instead need to set this flag on launch or programmatically.

Note, we have previously integrated various CEF versions (CEF1 v27 -> CEF3 v39, v45, etc) without encountering this issue.
It seems that the setting to allow unsandboxed plugins is off by default, despite disabling general sandboxing for the browser instance via various flags and settings in code.

Any suggestions on which flag(s) to use on launch or how to programmatically achieve this would be greatly appreciated.

-AL.

UPDATE 1

I have written a Chrome extension that is able to set the permission via a background js script :

Code: Select all
chrome.contentSettings.unsandboxedPlugins.set({
  'primaryPattern': "<all_urls>",
  'setting': "allow"
});


Image

However, I am not sure what underlying calls in CEF this resolves to, or I'd make the call directly in our own codebase.

I understand that Chrome extensions can not currently be integrated with CEF.
I had hoped that creating the extension would reveal something about the underlying CEF code.
Alas...

I have looked through _cef_browser_settings_t and apart from the plugins setting (which either enables or disables all plugins),
I do not see anything relevant to allowing unsandboxed plugins.

UPDATE 2

After trawling through the CEF source, I noticed this in our own branch, in content_settings.json :

Code: Select all
 "unsandboxedPlugins": {
        "$ref": "ContentSetting",
        "description": "Whether to allow sites to run plugins unsandboxed.
        One of <br><var>allow</var>: Allow sites to run plugins unsandboxed,
        <br><var>block</var>: Don't allow sites to run plugins unsandboxed,
        <br><var>ask</var>: Ask when a site wants to run a plugin unsandboxed.
        <br>Default is <var>ask</var>.
        <br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",
        "value": [
          "ppapi-broker",
          {"$ref":"PpapiBrokerContentSetting"}
        ]
      },


where PpapiBrokerContentSetting is defined as:

Code: Select all
  {
    "id": "PpapiBrokerContentSetting",
    "type": "string",
    "enum": ["allow", "block", "ask"]
  },


I would love to make changes to this and rebuild CEF, but rebuilding is an extremely arduous process that can take many days.

If anybody could advise on how to modify this so as to force "Allow" by default, it may be worth a rebuild.

My gut feeling is that removing "block" and "ask" from the PpapiBrokerContentSetting definition may achieve this,
but I definitely need confirmation from anybody with some know-how before going down that path.

Originally asked here : https://stackoverflow.com/questions/53101235/launching-cef3-with-unsandboxed-plugin-access-allowed
AltamishM
Newbie
 
Posts: 4
Joined: Mon Nov 05, 2018 2:06 am

Re: Launch CEF3 w/ Unsandboxed Plugin Access allowed

Postby magreenblatt » Mon Nov 05, 2018 10:04 am

I don't see the "Unsandboxed plugin access" option in current Google Chrome versions. Has the name changed?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Launch CEF3 w/ Unsandboxed Plugin Access allowed

Postby AltamishM » Tue Nov 06, 2018 3:23 am

magreenblatt wrote:I don't see the "Unsandboxed plugin access" option in current Google Chrome versions. Has the name changed?


If you view the site information and click on Site Settings, the following page should appear:

Image

Image
AltamishM
Newbie
 
Posts: 4
Joined: Mon Nov 05, 2018 2:06 am

Re: Launch CEF3 w/ Unsandboxed Plugin Access allowed

Postby AltamishM » Tue Nov 13, 2018 3:37 am

~bump~

Tried quite a few things.
Still in need of a solution or some advice...
AltamishM
Newbie
 
Posts: 4
Joined: Mon Nov 05, 2018 2:06 am

Re: Launch CEF3 w/ Unsandboxed Plugin Access allowed

Postby salvadordf » Tue Nov 13, 2018 4:46 am

I don't know if this would work for you but there are a couple browser preferences called "plugins.always_authorize" and "plugins.allow_outdated" that might be what you are looking for.

I would also try the "--autoplay-policy=no-user-gesture-required" command switch.
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects.
User avatar
salvadordf
Expert
 
Posts: 129
Joined: Sun Dec 18, 2016 8:39 am
Location: Spain

Re: Launch CEF3 w/ Unsandboxed Plugin Access allowed

Postby AltamishM » Tue Nov 13, 2018 10:24 am

salvadordf wrote:I don't know if this would work for you but there are a couple browser preferences called "plugins.always_authorize" and "plugins.allow_outdated" that might be what you are looking for.

I would also try the "--autoplay-policy=no-user-gesture-required" command switch.


I really appreciate the response :)

The always-authorize-plugins flag seemed very promising but unfortunately, does not work.

I may have to give up on this.
AltamishM
Newbie
 
Posts: 4
Joined: Mon Nov 05, 2018 2:06 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 103 guests