[Webkit-unassigned] [Bug 41292] New: [V8]When a NPAPI plugin calls NPN_Evaluate to execute script in browser, if the call is initiated by user, allow the popup

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 28 11:40:59 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41292

           Summary: [V8]When a NPAPI plugin calls NPN_Evaluate to execute
                    script in browser, if the call is initiated by user,
                    allow the popup
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebCore JavaScript
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jnd at chromium.org
                CC: abarth at webkit.org, dglazkov at chromium.org


Now YouTube's videos all have new new-window button on player (see the first attachment). When clicking that button on Chromium windows, nothing happened. The Chromium bug is here: http://crbug.com/43547

After investigation, I found the window.open was triggered in the script calling from Plugin side by using NPN_Evaluate interface.
In Chromium, the NPN_Evaluate called _NPN_EvaluateHelper(V8NPObject.cpp) to execute the script with passing a additional parameter "popupsAllowed".
The parameter "popupsAllowed" was from PluginInstance::popups_allowed() which was set when the input message could be considered as user gesture event (WebPluginDelegateImpl::IsUserGesture/WebPluginDelegateImpl::IsUserGestureMessage).

In chromium windows version, the input events to windowed plugin (for the youtube case) were handled by the plugin window, so the UserGestureIndicator had no chance to be set to right value:DefinitelyProcessingUserGesture. Also we didn't set right value for UserGestureIndicator when calling function _NPN_EvaluateHelper with "popupsAllowed":true, so the popup window was not considered as user initiated.

But in Safari Mac version, all input events even the input events to plugin are delivered by webview and handled by event handlers in WebCore/page/EventHandler.cpp) in which UserGestureIndicator is set to DefinitelyUserGesture, so the popup window is treated as user initiated.

To fix this issue on chromium, we may need to set UserGestureIndicator to DefinitelyProcessingUserGesture in function:_NPN_EvaluateHelper when popupsAllowed is true.

Any suggestions?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list