pushkin
pushkin

Reputation: 10227

What are the implications of turning on the plugins attribute of an Electron webview?

Can somebody explain what the plugins attribute of the Webview tag actually does? What plugins does it allow? Only those that I, the developer, add?

<webview src="example.com" plugins></webview>

The docs just say:

When this attribute is present the guest page in webview will be able to use browser plugins.

My Electron app needs to show PDFs, which I can only do by setting this attribute, but I want to make sure that there aren't other adverse effects/implications of turning this on.

I don't want some random plugins to be running that I don't have control of (my understanding is that extensions are installed by users, but plugins are "installed" by the Chrome team, and we can't control what runs [barring Flash and the PDF Viewer]).

Running navigator.plugins in the console window of my Electron app shows an array of one element with name Chromium PDF Viewer, which is reasurring, but is there a chance that another plugin will get in that array, or would I have to be the one who adds that plugin?


Update: As of Chrome 57 (Electron 2 uses Chrome 61), the only plugins that we can control are the PDF Viewer (which Electron apparently ships with) and Flash.

If we want to use the built-in PDF Viewer, we have no choice but to specify the plugins attribute and trust Chrome's other plugins.

To answer my question above:

Is there a chance that another plugin will get in that array, or would I have to be the one who adds that plugin?

It would appear that I would have to be the one that adds it, but again, that's not stopping other Chrome plugins from running.

Upvotes: 4

Views: 461

Answers (0)

Related Questions