Changeset 258476 in webkit


Ignore:
Timestamp:
Mar 14, 2020 5:14:33 PM (4 years ago)
Author:
Brent Fulgham
Message:

Add missing checks needed for AppBound Quirk
https://bugs.webkit.org/show_bug.cgi?id=209117
<rdar://problem/60460097>

Reviewed by John Wilander.

The checks for the 'NeedsInAppBrowserPrivacyQuirks' flag added in r258101 was incomplete.
Source/WebCore:

Two additional call sites need to check the state of the flag.

  • bindings/js/ScriptController.cpp:

(WebCore::ScriptController::executeScriptInWorld): Add missing check for the quirk.

  • loader/FrameLoaderClient.h: Add new API for the 'NeedsInAppBrowserPrivacyQuirks'

debug flag.

  • page/Frame.cpp:

(WebCore::Frame::injectUserScriptImmediately): Ditto.

Source/WebKit:

These changes let the WebFrameLoaderClient report the quirk state to WebCore code.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::needsInAppBrowserPrivacyQuirks): Added.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
  • WebProcess/WebPage/WebPage.h:

(WebKit::WebPage::needsInAppBrowserPrivacyQuirks const): Added.

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r258475 r258476  
     12020-03-14  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Add missing checks needed for AppBound Quirk
     4        https://bugs.webkit.org/show_bug.cgi?id=209117
     5        <rdar://problem/60460097>
     6
     7        Reviewed by John Wilander.
     8
     9        The checks for the 'NeedsInAppBrowserPrivacyQuirks' flag added in r258101 was incomplete.
     10        Two additional call sites need to check the state of the flag.
     11
     12        * bindings/js/ScriptController.cpp:
     13        (WebCore::ScriptController::executeScriptInWorld): Add missing check for the quirk.
     14        * loader/FrameLoaderClient.h: Add new API for the 'NeedsInAppBrowserPrivacyQuirks'
     15        debug flag.
     16        * page/Frame.cpp:
     17        (WebCore::Frame::injectUserScriptImmediately): Ditto.
     18
    1192020-03-10  Darin Adler  <darin@apple.com>
    220
  • trunk/Source/WebCore/bindings/js/ScriptController.cpp

    r257999 r258476  
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    33 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
    4  *  Copyright (C) 2006-2019 Apple Inc. All rights reserved.
     4 *  Copyright (C) 2006-2020 Apple Inc. All rights reserved.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    577577ValueOrException ScriptController::executeScriptInWorld(DOMWrapperWorld& world, RunJavaScriptParameters&& parameters)
    578578{
    579     if (m_frame.loader().client().hasNavigatedAwayFromAppBoundDomain())
     579    if (m_frame.loader().client().hasNavigatedAwayFromAppBoundDomain() && !m_frame.loader().client().needsInAppBrowserPrivacyQuirks())
    580580        return jsNull();
    581581
  • trunk/Source/WebCore/loader/FrameLoaderClient.h

    r258421 r258476  
    11/*
    2  * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006-2020 Apple Inc. All rights reserved.
    33 * Copyright (C) 2012 Google Inc. All rights reserved.
    44 *
     
    381381
    382382    virtual bool hasNavigatedAwayFromAppBoundDomain() { return false; }
    383 
     383    virtual bool needsInAppBrowserPrivacyQuirks() const { return false; }
    384384};
    385385
  • trunk/Source/WebCore/page/Frame.cpp

    r258339 r258476  
    66 *                     2000 Stefan Schimanski <1Stein@gmx.de>
    77 *                     2001 George Staikos <staikos@kde.org>
    8  * Copyright (C) 2004-2019 Apple Inc. All rights reserved.
     8 * Copyright (C) 2004-2020 Apple Inc. All rights reserved.
    99 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
    1010 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
     
    625625void Frame::injectUserScriptImmediately(DOMWrapperWorld& world, const UserScript& script)
    626626{
    627     if (loader().client().hasNavigatedAwayFromAppBoundDomain())
     627    if (loader().client().hasNavigatedAwayFromAppBoundDomain() && !loader().client().needsInAppBrowserPrivacyQuirks())
    628628        return;
    629629
  • trunk/Source/WebKit/ChangeLog

    r258475 r258476  
     12020-03-14  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Add missing checks needed for AppBound Quirk
     4        https://bugs.webkit.org/show_bug.cgi?id=209117
     5        <rdar://problem/60460097>
     6
     7        Reviewed by John Wilander.
     8
     9        The checks for the 'NeedsInAppBrowserPrivacyQuirks' flag added in r258101 was incomplete.
     10        These changes let the WebFrameLoaderClient report the quirk state to WebCore code.
     11
     12        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     13        (WebKit::WebFrameLoaderClient::needsInAppBrowserPrivacyQuirks): Added.
     14        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
     15        * WebProcess/WebPage/WebPage.h:
     16        (WebKit::WebPage::needsInAppBrowserPrivacyQuirks const): Added.
     17
    1182020-03-10  Darin Adler  <darin@apple.com>
    219
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r258458 r258476  
    11/*
    2  * Copyright (C) 2010-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    19371937}
    19381938
     1939bool WebFrameLoaderClient::needsInAppBrowserPrivacyQuirks() const
     1940{
     1941    auto* webPage = m_frame->page();
     1942    if (!webPage)
     1943        return false;
     1944   
     1945    return webPage->needsInAppBrowserPrivacyQuirks();
     1946}
     1947
     1948
    19391949} // namespace WebKit
    19401950
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

    r258421 r258476  
    11/*
    2  * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    290290
    291291    bool hasNavigatedAwayFromAppBoundDomain() final;
     292    bool needsInAppBrowserPrivacyQuirks() const final;
    292293};
    293294
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r258421 r258476  
    11/*
    2  * Copyright (C) 2010-2019 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    13011301    NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; }
    13021302    void setHasNavigatedAwayFromAppBoundDomain(NavigatedAwayFromAppBoundDomain navigatedAwayFromAppBoundDomain) { m_hasNavigatedAwayFromAppBoundDomain = navigatedAwayFromAppBoundDomain; }
    1303 
     1303    bool needsInAppBrowserPrivacyQuirks() const { return m_needsInAppBrowserPrivacyQuirks; }
     1304   
    13041305    bool shouldUseRemoteRenderingFor(WebCore::RenderingPurpose);
    13051306   
Note: See TracChangeset for help on using the changeset viewer.