New issue
Advanced search Search tips

Issue 612200 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

navigator.plugins and navigator.mimeTypes don't work in OOPIFs

Project Member Reported by alex...@chromium.org, May 16 2016

Issue description

1. Launch Chrome with --site-per-process (I used Linux dev 52.0.2729.3)
2. Go to http://csreis.github.io/tests/cross-site-iframe-simple.html
3. Inspect the subframe.
4. Evaluate navigator.mimeTypes and navigator.plugins.

Both come out as null.  

Without --site-per-process, or when doing this in the main frame, both evaluate to meaningful non-zero arrays with pdf, swf, etc.

The problem is in this check in Page::pluginData:
    if (!mainFrame()->isLocalFrame()
        || !deprecatedLocalMainFrame()->loader().allowPlugins(NotAboutToInstantiatePlugin))
        return nullptr;

which just aborts early when the main frame is not local.  Looks like we'll need to fix up allowPlugins to work with OOPIFs.  There's no problem actually getting this data from an OOPIF -- if we skip the allowPlugins check, things just work.

 

Comment 1 by creis@chromium.org, May 16 2016

Components: Internals>Plugins
Labels: -Pri-3 Proj-IsolateExtensions-BlockingLaunch Pri-2
Nice find.  Alex, would you be able to fix this while you're looking into the Flash fullscreen work?  I agree that we should probably get this to work for launch.
Cc: -alex...@chromium.org
Owner: alex...@chromium.org
Status: Assigned (was: Available)
Yes, I'll take a look.  It doesn't look too bad.
Project Member

Comment 3 by bugdroid1@chromium.org, May 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fb92f3e718335521cf454e53651235fbf30c10e2

commit fb92f3e718335521cf454e53651235fbf30c10e2
Author: alexmos <alexmos@chromium.org>
Date: Fri May 20 01:03:52 2016

Fix navigator.plugins and navigator.mimeTypes for OOPIFs.

Previously, Page::pluginData() returned nullptr when the Page's main
frame was a RemoteFrame.  This caused navigator.plugins and
navigator.mimeTypes to both return empty arrays from an OOPIF.

Page::pluginData() needed the main frame to run the
FrameLoader::allowPlugins check on it.  This CL moves this check to
happen on the actual LocalFrame that needs to access
Page::pluginData().

BUG= 612200 ,  607981 

Review-Url: https://codereview.chromium.org/1990343002
Cr-Commit-Position: refs/heads/master@{#394942}

[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process
[add] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/LayoutTests/http/tests/plugins/navigator-plugins-in-cross-origin-frame-expected.txt
[add] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/LayoutTests/http/tests/plugins/navigator-plugins-in-cross-origin-frame.html
[add] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/LayoutTests/http/tests/plugins/resources/navigator-plugins-frame.html
[add] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/LayoutTests/http/tests/plugins/resources/navigator-plugins.js
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/core/dom/DOMImplementation.cpp
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/core/frame/LocalFrame.h
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/core/page/Page.cpp
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.cpp
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/modules/plugins/DOMPluginArray.cpp
[modify] https://crrev.com/fb92f3e718335521cf454e53651235fbf30c10e2/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp

Status: Fixed (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 1 2016

Labels: merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bc0578a78ae310a0216210e9e6894537acb7d8e6

commit bc0578a78ae310a0216210e9e6894537acb7d8e6
Author: Alex Moshchuk <alexmos@chromium.org>
Date: Fri Jul 01 22:03:34 2016

Fix navigator.plugins and navigator.mimeTypes for OOPIFs.

Previously, Page::pluginData() returned nullptr when the Page's main
frame was a RemoteFrame.  This caused navigator.plugins and
navigator.mimeTypes to both return empty arrays from an OOPIF.

Page::pluginData() needed the main frame to run the
FrameLoader::allowPlugins check on it.  This CL moves this check to
happen on the actual LocalFrame that needs to access
Page::pluginData().

BUG= 612200 ,  607981 ,  616445 

Review-Url: https://codereview.chromium.org/1990343002
Cr-Commit-Position: refs/heads/master@{#394942}
(cherry picked from commit fb92f3e718335521cf454e53651235fbf30c10e2)

Review URL: https://codereview.chromium.org/2121433002 .

Cr-Commit-Position: refs/branch-heads/2743@{#572}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process
[add] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/LayoutTests/http/tests/plugins/navigator-plugins-in-cross-origin-frame-expected.txt
[add] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/LayoutTests/http/tests/plugins/navigator-plugins-in-cross-origin-frame.html
[add] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/LayoutTests/http/tests/plugins/resources/navigator-plugins-frame.html
[add] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/LayoutTests/http/tests/plugins/resources/navigator-plugins.js
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/core/dom/DOMImplementation.cpp
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/core/frame/LocalFrame.h
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/core/page/Page.cpp
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.cpp
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/modules/plugins/DOMPluginArray.cpp
[modify] https://crrev.com/bc0578a78ae310a0216210e9e6894537acb7d8e6/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp

Labels: TE-Verified-52.0.2743.75 TE-Verified-M52
Verified the issue on Ubuntu 14.04,Mac 10.11.5 and Win 7 using 52.0.2743.75 and its working fine.Please find the screen cast for the same.
612200_July_13.ogv
3.2 MB View Download

Sign in to add a comment