Support Fresh Player Plugin

Bug #1382908 reported by Michael Lawton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nuvola Apps Runtime (Nuvola Player)
Fix Released
Medium
Unassigned
WebKit
Invalid
Medium

Bug Description

http://www.webupd8.org/2014/05/install-fresh-player-plugin-in-ubuntu.html
https://github.com/i-rinat/freshplayerplugin

This plugin enables firefox to use flash player 15. Nuvola player just ignores it though. Reading some other bugs it looks like using a 32 bit version with nspluginwrapper may be all it needs to work.

Xbox music needs flash > 11.2 to work and now works in firefox. I have developed an xbox music service integration but can't try it out until xbox music works in nuvola player.

Revision history for this message
In , Jiří Janoušek (fenryxo) wrote :

Hi,

the documentation of WebKitPlugin class[1] states "This object can be used to get more information about a plugin, and enable/disable it, allowing fine-grained control of plugins.", but I can't see any function to disable a particular plugin. I would use such a function to disable all plugins except a preferred Flash plugin implementation (Adobe Flash, Gnash, Lightspark, Pipelight, ...) as requested by users of my app (Nuvola Player).

[1] http://webkitgtk.org/reference/webkit2gtk/unstable/WebKitPlugin.html

Thank you.

Revision history for this message
Jiří Janoušek (fenryxo) wrote :

Thanks for your feature request. Could you run "nuvolaplayer -D" (without quotes) in teminal and paste here lines containing
 "Nuvola Debug nuvola-formatsupport.vala ... WebPlugin ..."?

Changed in nuvola-player:
status: New → Incomplete
Revision history for this message
Michael Lawton (flangefrog) wrote :
Download full text (5.6 KiB)

michael@Michael-Ubuntu:~$ nuvolaplayer -D
    Nuvola Info nuvolaplayer.vala:150: Welcome to Nuvola Player, version: 2.4.3
    Nuvola Info nuvolaplayer.vala:154: Revision: 852, <email address hidden>
    Nuvola Info nuvolaplayer.vala:155: Report any issues/bugs you might find to http://nuvolaplayer.fenryxo.cz/support/bug_reporting.html
    Nuvola Debug nuvolaplayer.vala:156: command: /usr/lib/nuvolaplayer/nuvolaplayer -D
    Nuvola Debug nuvolaplayer.vala:158: Enabled features: Unity Quicklist, optimization of SVG images, Last.fm scrobbling, Notifications, debug symbols
    Nuvola Debug nuvolaplayer.vala:159: Disabled features: experimental features, debug memory usage
       Gtk Debug Connecting to session manager
    Nuvola Debug nuvolaplayer.vala:241: Starting new instance
   Diorite Debug Libsoup version: 2.44.2
    Nuvola Debug nuvola-formatsupport.vala:97: Unable to init GStreamer 1.2.4, maybe already initialized
    Nuvola Debug core.vala:59: Cache model: default
   Diorite Debug Max data cache size: 100
   Diorite Debug Setting proxy (auto): dynamic resolver
 <unknown> Debug NP_Initialize
 <unknown> Debug NP_Initialize succeeded
 <unknown> Debug NP_Initialize
 <unknown> Debug NP_Initialize succeeded
 <unknown> Debug NP_Initialize
 <unknown> Debug NP_Initialize succeeded
Gtk-Message: Failed to load module "overlay-scrollbar"
Gtk-Message: Failed to load module "unity-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
 <unknown> Debug NP_Initialize
 <unknown> Debug NP_Initialize succeeded
    Nuvola Debug nuvola-formatsupport.vala:213: WebPlugin: Java(TM) Plug-in 11.25.2 (false): /usr/lib/mozilla/plugins/libjavaplugin.so
    Nuvola Debug nuvola-formatsupport.vala:213: WebPlugin: VLC Multimedia Plugin (compatible Videos 3.10.1) (false): /usr/lib/mozilla/plugins/libtotem-cone-plugin.so
    Nuvola Debug nuvola-formatsupport.vala:213: WebPlugin: DivX® Web Player (false): /usr/lib/mozilla/plugins/libtotem-mully-plugin.so
    Nuvola Debug nuvola-formatsupport.vala:213: WebPlugin: QuickTime Plug-in 7.6.6 (false): /usr/lib/mozilla/plugins/libtotem-narrowspace-plugin.so
    Nuvola Debug nuvola-formatsupport.vala:213: WebPlugin: iTunes Application Detector (false): /usr/lib/mozilla/plugins/librhythmbox-itms-detection-plugin.so
    Nuvola Debug nuvola-formatsupport.vala:213: WebPlugin: Windows Media Player Plug-in 10 (compatible; Videos) (false): /usr/lib/mozilla/plugins/libtotem-gmp-plugin.so
    Nuvola Debug nuvola-formatsupport.vala:213: WebPlugin: Shockwave Flash (true): /opt/nuvolaplayer/flash/wrapped/npwrapper.libflashplayer.so
    Nuvola Debug nuvola-formatsupport.vala:139: Built with Gstreamer 1.2.4
    Nuvola Debug nuvola-formatsupport.vala:117: GStreamer 1.2.4 launch playbin uri=file:///usr/share/nuvolaplayer/audio/audiotest.mp3
    Nuvola Debug unity_quick_list.vala:67: Unity Launcher Entry for nuvolaplayer.desktop
    Nuvola Info extensionsmanager.vala:91: Extension with id 'unityquicklist' loaded.
    Nuvola Info extensionsmanager.vala:91: Extension with id 'trayicon' loaded.
    Nuvo...

Read more...

Revision history for this message
Jiří Janoušek (fenryxo) wrote :

If you have Ubuntu 14.04 on newer, could you install WebKit2GTK+ and check whether does Xbox music work in WebKit2GTK+ MiniBrowser?

sudo apt-get install libwebkit2gtk-3.0-25

/usr/lib/x86_64-linux-gnu/webkit2gtk-3.0/libexec/MiniBrowser
or
/usr/lib/i386-linux-gnu/webkit2gtk-3.0/libexec/MiniBrowser

Revision history for this message
Michael Lawton (flangefrog) wrote :

I have actually already done that. MiniBrowser doesn't work with Xbox Music as it doesn't load the Fresh Player plugin either.

Would the solutions described here work? https://bugs.launchpad.net/nuvola-player/+bug/1058586
As I understand it, that would require a 32bit fresh player to be wrapped with nspluginwrapper so it can run on a 64 bit system. I don't know how to do this myself though.

Revision history for this message
Jiří Janoušek (fenryxo) wrote :

Although it might be possible to wrap Fresh Player plugin with nspluginwrapper, I have no interest in playing further with this ugly workaround. The development focus is currently on Nuvola Player 3, so I would rather examine why the Fresh Player plugin doesn't load in WebKit2GTK+ (used by Nuvola Player 3) and consult this issue with the Fresh Player plugin developer.

Note to self: Install Fresh player plugin and check whether it is returned in the plugin list in WebKit2Gtk+:
http://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebContext.html#webkit-web-context-get-plugins

Changed in nuvola-player:
milestone: none → 3.0.0
status: Incomplete → Triaged
importance: Undecided → Medium
Revision history for this message
Jiří Janoušek (fenryxo) wrote :

Actually, the Fresh player plugin does load in WebKit2GTK+ MiniBrowser successfully. There is one catch though: If both the classic NPAPI Flash plugin 11.2 and the Fresh Player Flash plugin 15.0 are installed, WebKit2Gtk uses the first one. Once the classic NPAPI Flash plugin 11.2 is uninstalled, the Fresh Player Flash plugin 15.0 is used.

To sum up:

- No plan to support the Fresh player plugin in Nuvola Player 2 via nspluginwrapper.
- Fresh player plugin support in Nuvola Player 3 requires a way how to disable the the classic NPAPI Flash plugin 11.2 in WebKit2GTK+.

Revision history for this message
In , Jiří Janoušek (fenryxo) wrote :

When both the NPAPI Adobe Flash plugin 11.2 and the Fresh-player-wrapped PPAPI Adobe Flash plugin 15.0 are installed, WebKit2Gtk uses the old 11.2 Flash plugin and ignores the newer version. A method webkit_plugin_set_enabled () would be really helpful to let user disable the old Flash plugin and make sure the new one is used.

Revision history for this message
Jiří Janoušek (fenryxo) wrote :

There is currently no way how to disable the old Flash plugin 11.2 and prefer the new Flash plugin 15.0 in WebKit2GTK+. I've filled upstream bug report: https://bugs.webkit.org/show_bug.cgi?id=134357

Revision history for this message
Jiří Janoušek (fenryxo) wrote :

Added a screenshot from Nuvola Player 3 master to illustrate the issue.

Changed in nuvola-player:
status: Triaged → Fix Committed
Revision history for this message
In , carloslp (carloslp) wrote :

(In reply to comment #1)
> When both the NPAPI Adobe Flash plugin 11.2 and the Fresh-player-wrapped
> PPAPI Adobe Flash plugin 15.0 are installed, WebKit2Gtk uses the old 11.2
> Flash plugin and ignores the newer version. A method
> webkit_plugin_set_enabled () would be really helpful to let user disable the
> old Flash plugin and make sure the new one is used.

Please note that WebKit don't supports PPAPI plugins.

Revision history for this message
In , Mrobinson-d (mrobinson-d) wrote :

(In reply to comment #2)
> (In reply to comment #1)
> > When both the NPAPI Adobe Flash plugin 11.2 and the Fresh-player-wrapped
> > PPAPI Adobe Flash plugin 15.0 are installed, WebKit2Gtk uses the old 11.2
> > Flash plugin and ignores the newer version. A method
> > webkit_plugin_set_enabled () would be really helpful to let user disable the
> > old Flash plugin and make sure the new one is used.
>
> Please note that WebKit don't supports PPAPI plugins.

Fresh-player appears to be an NPAPI wrapper for PPAPI plugins: https://github.com/i-rinat/freshplayerplugin.

Changed in webkit-open-source:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

Created attachment 242994
Patch

Revision history for this message
In , Commit-queue (commit-queue) wrote :

Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API

Revision history for this message
In , Commit-queue (commit-queue) wrote :

Attachment 242994 did not pass style-queue:

ERROR: Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h:65: Extra space before ( in function call [whitespace/parens] [4]
WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitPlugin.h"
ERROR: Source/WebKit2/UIProcess/API/gtk/WebKitPlugin.cpp:25: Alphabetical sorting problem. [build/include_order] [4]
ERROR: Source/WebKit2/UIProcess/API/gtk/WebKitPlugin.cpp:180: Extra space before ( in function call [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:125: all_plugins is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4]
ERROR: Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:125: loaded_plugins is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4]
ERROR: Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:142: Multi line control clauses should use braces. [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:148: Extra space before ( in function call [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:154: Extra space before ( in function call [whitespace/parens] [4]
Total errors found: 8 in 7 files

If any of these errors are false positives, please file a bug against check-webkit-style.

Revision history for this message
In , Cgarcia-f (cgarcia-f) wrote :

Comment on attachment 242994
Patch

I don't see how this can work. To have a WebKitPlugin object, you need to the plugin to be loaded, since it's the way to have a PluginModuleInfo, so it's imposible to disable a plugin before being loaded using WebKitPlugin API. What we want is not to disable a plugin load (in most of the cases the plugin cache will be used), but to block those plugin instances so that the plugin process is not even spawned. So, maybe webkit_plugin_block/unblock or set_blocked is_blocked would be better names. Please, provide a unit test to check things are working as expected. You should implement pluginLoadPolicy loader client callback and return PluginModuleBlocked, for the blocked plugins and PluginModuleLoadNormally for the others

Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

Created attachment 243189
Patch

Revision history for this message
In , Cgarcia-f (cgarcia-f) wrote :

Comment on attachment 243189
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=243189&action=review

After thinking about this again, I think we could expose this in a different way, giving more control to the application. We could expose the pluginLoadPolicy callback as a signal of WebKitWebView, where the user can connect to decide what to do about the plugin. And we should also expose the unavailablePluginButtonClicked so that the application can ask the user whether to enable the particular plugin or not and reload the page. This way, it's the application the one keeping the list of blocking plugins, and we keep the WebKitPlugin object as read-only.

> Source/WebKit2/Shared/Plugins/PluginModuleInfo.h:62
> + bool isBlocked;

I don't think we need to keep this here. This is for the information that the plugin provides, not for the plugin state.

> Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp:123
> + bool blocked = toImpl(pluginInfoDictionary)->get<API::Boolean>(pluginInformationIsBlockedKey())->value();
> + return blocked ? PluginModuleBlocked : PluginModuleLoadNormally;

We should provide the unavailabilityDescription, I guess. I think we should keep the list of plugins blocked in GTK specific code, and check here if the given plugin is blocked or not.

> Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp:168
> 0, // didLayout
> 0, // pluginLoadPolicy_deprecatedForUseWithV2
> 0, // pluginDidFail
> - 0, // pluginLoadPolicy
> + pluginLoadPolicy // pluginLoadPolicy

What happens when a plugin is blocked and the user clicks on the unavailable button? I think we should also implement unavailablePluginButtonClicked in the UI client.

> Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp:71
> +#if PLATFORM(GTK)
> + if (PluginInfoStore::m_loadedPluginListIsUpToDate)
> +#endif

I don't understand why this is needed. The pluginLoadPolicy will be called every time the page is reloaded and there are plugins.

> Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp:96
> +#if PLATFORM(GTK)
> + PluginInfoStore::m_loadedPluginListIsUpToDate = true;
> +#endif

Ditto.

> Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h:65
> +#if PLATFORM(GTK)
> + static void setBlockedPlugin(PluginModuleInfo&, bool);
> +#endif

This could be handled in the GTK+ specific code.

> Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h:110
> +#if PLATFORM(GTK)
> + static Vector<String> m_blockedPluginsPaths;
> + static bool m_loadedPluginListIsUpToDate;
> +#endif

Ditto.

> Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:107
> + for (const auto& blocked_plugin_path : m_blockedPluginsPaths) {

blocked_plugin_path -> blockedPluginPath

Revision history for this message
In , Cgarcia-f (cgarcia-f) wrote :

We should also consider exposing didBlockInsecurePluginVersion for plugins that don't have a representation in the web page, for example flash playing audio only, so that the app knows there's a plugin blocked and can ask the user.

Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

Created attachment 248056
Patch

Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

Created attachment 248058
Patch

Revision history for this message
Jiří Janoušek (fenryxo) wrote :

Issue is fixed in Nuvola Player 3 Beta. http://tiliado.github.io/nuvolaplayer/documentation/3.0.html

Changed in nuvola-player:
status: Fix Committed → Fix Released
Revision history for this message
In , Svillar (svillar) wrote :

I think we could use this bug to provide an API to selectively disable plugins even per host based blocking specially after https://bugs.webkit.org/show_bug.cgi?id=142506 has landed.

Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

I have just send an email to webkitgtk+ mailing list proposing a API to implement selective disable plugins.

Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

Created attachment 250424
Patch

Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

I have beed working last weeks on modifying my patch to support declarative set of plugin load policies.

In spite of the fact that it do work know, this is a WIP still but any review/idea are really wellcome.

Appart from the previous created signals load-plugin, blocked-plugin and unavailable-plugin-activated, I have implement two methods to set and clear plugin load policies in a declarative way. So, webkit_plugin_set_client_load_policy can be used for set the load policy for a certain host and plugin and webkit_context_clear_policies could be used for clear all established policies. We have to take into account that there is no persistence at all in this policies so when we restart our application, the previous established policies will be gone. Thats why the application should store a list of policies established for plugins and the API does not provide a webkit_plugin_get_client_load_policy.

Both implemented methods expose the WebProccessPool methods created by r181562 (http://trac.webkit.org/changeset/181562). These methods update a local hashmap that contains all created policies and then they send a message to the WebProcess which also updates a local hashmap.

The problem is that these methods use BundleId and Version to identify each plugin and we dont have that in GTK+ so, I have use the filename instead of the bundleId and I have hardcoded the versionId to "*".

On the other hand the solution to get the established plugin policy for a certain plugin and host in load-plugin is a litle hacky... I have implement a method getPluginLoadClientPolicy in WebProcessPool. This method gets the established policy for a plugin finding the key in the WebProccessPool local array. Mac port seems to be doing this using other ways but I have not found any alternative.

The plugin information provided to load-plugin is a dictionary created using a PluginModuleInfo data obtained from PluginInfoStore. In GTK we use a cache to store the PluginModuleInfo for each plugin and this cache is only updated when the file changed.

In addition the created test has a race condition so It it timeouts if we dont have the wait instruction on line 900 of the TestWebKitWebView.cpp file.

Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

Created attachment 250508
Patch

Revision history for this message
In , Chavarria1991 (chavarria1991) wrote :

After the email send by Carlos Garcia to the mailing list, we have conclude that block plugins and disable plugins are different things and they should be implemented on different bugs. So I re-upload the work I had done about blocking plugins with some tiny fixes. Any review would be really appreciated.

Revision history for this message
In , Cgarcia-f (cgarcia-f) wrote :

Plugins are no longer supported.

Changed in webkit-open-source:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.