Skip to content

Commit

Permalink
Cherry-pick f2404c1. rdar://121471373
Browse files Browse the repository at this point in the history
    [iOS] YouTube does not provide an AirPlay button in fullscreen mode
    https://bugs.webkit.org/show_bug.cgi?id=268634
    rdar://121471373

    Reviewed by Brent Fulgham and Aditya Keerthi.

    Add a quirk to disable the Fullscreen API on YouTube.com (and youtube.com embeds).

    * Source/WebCore/page/Quirks.cpp:
    (WebCore::Quirks::shouldDisableElementFullscreenQuirk const):

    Canonical link: https://commits.webkit.org/274117@main

Identifier: 272448.546@safari-7618-branch
  • Loading branch information
jernoble authored and Dan Robson committed Feb 13, 2024
1 parent 47c5c14 commit c9c2a92
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/WebCore/page/Quirks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
#include <JavaScriptCore/SourceProvider.h>
#include <JavaScriptCore/StackVisitor.h>

#if PLATFORM(IOS_FAMILY)
#include <pal/system/ios/UserInterfaceIdiom.h>
#endif

#if PLATFORM(COCOA)
#include <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
#endif
Expand Down Expand Up @@ -424,10 +428,13 @@ bool Quirks::shouldDisableElementFullscreenQuirk() const
// Twitter.com video embeds have controls that are too tiny and
// show page behind fullscreen.
// (Ref: rdar://121473410)
// YouTube.com does not provide AirPlay controls in fullscreen
// (Ref: rdar://121471373)
if (!m_shouldDisableElementFullscreen) {
m_shouldDisableElementFullscreen = isDomain("vimeo.com"_s)
|| isDomain("instagram.com"_s)
|| isEmbedDomain("twitter.com"_s);
|| isEmbedDomain("twitter.com"_s)
|| (PAL::currentUserInterfaceIdiomIsSmallScreen() && (isDomain("youtube.com"_s) || isEmbedDomain("youtube.com"_s)));
}

return m_shouldDisableElementFullscreen.value();
Expand Down

0 comments on commit c9c2a92

Please sign in to comment.