⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 194367 in webkit


Ignore:
Timestamp:
Dec 22, 2015, 11:37:50 AM (11 years ago)
Author:
Brent Fulgham
Message:

Allow JavaScript to iterate over plugins for local SecurityOrigins
​https://bugs.webkit.org/show_bug.cgi?id=152489

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Instead of calling 'isLocalFile' on the URL, we check the Document's SecurityOrigin. If
no origin exists, we construct a SecurityOrigin from the URL, and check whether it
satisfies 'isLocal'.

  • page/Page.cpp:

(WebCore::Page::showAllPlugins): Revised to use SecurityOrigin.

Source/WebKit2:

The 'getWebVisiblePluginInfo' is filtering plugins, even when we want to list
all plugins. To avoid this, we check the Document's SecurityOrigin. If no such
origin exists, we construct a SecurityOrigin from the URL.

If the relevant SecurityOrigin satsifies 'isLocal', we show all plugins.

  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:

(WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r194362 r194367  
     12015-12-22  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Allow JavaScript to iterate over plugins for local SecurityOrigins
     4        https://bugs.webkit.org/show_bug.cgi?id=152489
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Instead of calling 'isLocalFile' on the URL, we check the Document's SecurityOrigin. If
     9        no origin exists, we construct a SecurityOrigin from the URL, and check whether it
     10        satisfies 'isLocal'.
     11
     12        * page/Page.cpp:
     13        (WebCore::Page::showAllPlugins): Revised to use SecurityOrigin.
     14
    1152015-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>
    216
  • trunk/Source/WebCore/page/Page.cpp

    r194006 r194367  
    525525bool Page::showAllPlugins() const
    526526{
    527     return m_showAllPlugins || mainFrame().loader().documentLoader()->url().isLocalFile();
     527    if (m_showAllPlugins)
     528        return true;
     529
     530    if (Document* document = mainFrame().document()) {
     531        if (SecurityOrigin* securityOrigin = document->securityOrigin())
     532            return securityOrigin->isLocal();
     533    }
     534
     535    return false;
    528536}
    529537
  • trunk/Source/WebCore/page/SecurityOrigin.h

    r185231 r194367  
    162162    // The local SecurityOrigin can script any document, navigate to local
    163163    // resources, and can set arbitrary headers on XMLHttpRequests.
    164     bool isLocal() const;
     164    WEBCORE_EXPORT bool isLocal() const;
    165165
    166166    // The origin is a globally unique identifier assigned when the Document is
  • trunk/Source/WebKit2/ChangeLog

    r194359 r194367  
     12015-12-22  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Allow JavaScript to iterate over plugins for local SecurityOrigins
     4        https://bugs.webkit.org/show_bug.cgi?id=152489
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        The 'getWebVisiblePluginInfo' is filtering plugins, even when we want to list
     9        all plugins. To avoid this, we check the Document's SecurityOrigin. If no such
     10        origin exists, we construct a SecurityOrigin from the URL.
     11       
     12        If the relevant SecurityOrigin satsifies 'isLocal', we show all plugins.
     13
     14        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     15        (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
     16
    1172015-12-21  Hunseop Jeong  <hs85.jeong@samsung.com>
    218
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r193468 r194367  
    4949#include "WebProcessProxyMessages.h"
    5050#include <WebCore/Color.h>
     51#include <WebCore/Document.h>
    5152#include <WebCore/DocumentLoader.h>
    5253#include <WebCore/IDBFactoryBackendInterface.h>
    … …  
    190191
    191192#if PLATFORM(MAC)
     193    if (Document* document = page->mainFrame().document()) {
     194        if (SecurityOrigin* securityOrigin = document->securityOrigin()) {
     195            if (securityOrigin->isLocal())
     196                return;
     197        }
     198    }
     199   
    192200    for (int32_t i = plugins.size() - 1; i >= 0; --i) {
    193201        PluginInfo& info = plugins.at(i);
Note: See TracChangeset for help on using the changeset viewer.