[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
This commit is contained in:
-46
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user