From 51dbde1261671e15e5c958edd1abe1468e6df124 Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Thu, 30 Apr 2026 09:54:46 -0400 Subject: [PATCH] [iOS] Remove FullscreenHelper JavaScript (#36022) The purpose of this script was to enable fullscreen support on iPads for devices that didn't yet have support, however as of iOS 16.4 this API is fully featured on iPads already so there is no reason to inject it anymore since our minimum deployment target is iOS 17 --- .../AtDocumentStart/FullscreenHelper.js | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 ios/brave-ios/Sources/Brave/Frontend/UserContent/UserScripts/AllFrames/AtDocumentStart/FullscreenHelper.js diff --git a/ios/brave-ios/Sources/Brave/Frontend/UserContent/UserScripts/AllFrames/AtDocumentStart/FullscreenHelper.js b/ios/brave-ios/Sources/Brave/Frontend/UserContent/UserScripts/AllFrames/AtDocumentStart/FullscreenHelper.js deleted file mode 100644 index 64bb5fc5661..00000000000 --- a/ios/brave-ios/Sources/Brave/Frontend/UserContent/UserScripts/AllFrames/AtDocumentStart/FullscreenHelper.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2022 The Brave Authors. All rights reserved. -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this file, -// You can obtain one at https://mozilla.org/MPL/2.0/. - -window.__firefox__.includeOnce('FullscreenHelper', function($) { - let isFullscreenSupportedNatively = document.fullscreenEnabled || - document.webkitFullscreenEnabled || document.mozFullScreenEnabled || - document.msFullscreenEnabled; - - let videosSupportFullscreen = HTMLVideoElement.prototype.webkitEnterFullscreen !== undefined - - if (!isFullscreenSupportedNatively && videosSupportFullscreen && !/mobile/i.test(navigator.userAgent)) { - - HTMLElement.prototype.requestFullscreen = $(function() { - if (this.webkitRequestFullscreen !== undefined) { - this.webkitRequestFullscreen(); - return true; - } - - if (this.webkitEnterFullscreen !== undefined) { - this.webkitEnterFullscreen(); - return true; - } - - var video = this.querySelector("video") - if (video !== undefined) { - video.webkitEnterFullscreen(); - return true; - } - return false; - }); - - Object.defineProperty(document, 'fullscreenEnabled', { - get: function() { - return true; - } - }); - - Object.defineProperty(document.documentElement, 'fullscreenEnabled', { - get: function() { - return true; - } - }); - } -});