Plugins in WebView

Mathieu Ducharme ducharme.mathieu at gmail.com
Thu Feb 25 23:10:28 CET 2010


Hi,

I would like to propose allowing plasmoids to enable plugins (ie.
Flash) in the WebView widget.
I can tell that I personally expected the current Web Browser to be
able to play flash videos when I tried it...

Anyway, I'm not sure if it is currently possible in C++ (does not seem
so), but the scripting API does not have access to WebView settings so
I added the following functions to Plasma::WebView

- bool pluginsEnabled()
- void setPluginsEnabled(bool)

[Attached is a .diff to apply in trunk/KDE/kdelibs/plasma/widgets]

It works fine for me I could see youtube videos in a test javascript plasmoid:

var layout = new LinearLayout();
var web = new WebView();
web.pluginsEnabled = true; // Yay!
web.url('http://www.youtube.com');
layout.addItems(web);

There was a few issues with video position in the page which would
have to be found & fixed but are obviously unrelated to this patch,
which only enables the plugin.
(BTW Could those be the same issues that the VideoWidget have?)
Those issues could also only be local, as flash is already unstable on
my development VBox image... [that is, more than its usual
instability]

I was wondering if this was appropriate or if it opens the gates to
too many such helper functions, as there are other settings that might
be interesting to have access to:
http://doc.trolltech.com/4.6/qwebsettings.html

I guess the alternative could be to allow access the the
QWebView::settings() object.

So I would like to open the discussion on this feature, I know a few
participants in the javascript jam would love to have this ;)

Mathieu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trunk.KDE.kdelibs.plasma.widgets.webview_plugins.diff
Type: text/x-diff
Size: 1711 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100225/ad670b49/attachment.bin 


More information about the Plasma-devel mailing list