about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2023-03-22 15:25:27 +0100
committeraszlig <aszlig@nix.build>2023-03-22 17:30:39 +0100
commit3e4543020f165af1162f23474e6ad66f391c48ef (patch)
tree996c1fdebb794d54f795745a7f0738221b31a049
parent8c5e8e1e04a14fce3dd7d42197636a47afea110a (diff)
firefox: Rebase mute-by-default patch against v111
Firefox version 111.0 has refactored AutoplayPolicy.cpp a but and there
is now a handy "IsWindowAllowedToPlayByUserGesture" function that is
more convenient in that we just need to patch it to *always* return
false.

Signed-off-by: aszlig <aszlig@nix.build>
-rw-r--r--pkgs/aszlig/firefox/mute-by-default.patch19
1 files changed, 11 insertions, 8 deletions
diff --git a/pkgs/aszlig/firefox/mute-by-default.patch b/pkgs/aszlig/firefox/mute-by-default.patch
index 67e6bce4..337ccf0f 100644
--- a/pkgs/aszlig/firefox/mute-by-default.patch
+++ b/pkgs/aszlig/firefox/mute-by-default.patch
@@ -1,11 +1,15 @@
 diff --git a/dom/media/autoplay/AutoplayPolicy.cpp b/dom/media/autoplay/AutoplayPolicy.cpp
-index 77c53ce58acd..688af016a72c 100644
+index 8da0e60ead..90991bf1dc 100644
 --- a/dom/media/autoplay/AutoplayPolicy.cpp
 +++ b/dom/media/autoplay/AutoplayPolicy.cpp
-@@ -78,15 +78,6 @@ static bool IsWindowAllowedToPlay(nsPIDOMWindowInner* aWindow) {
-     return true;
-   }
+@@ -69,18 +69,6 @@ static uint32_t SiteAutoplayPerm(nsPIDOMWindowInner* aWindow) {
+ }
  
+ static bool IsWindowAllowedToPlayByUserGesture(nsPIDOMWindowInner* aWindow) {
+-  if (!aWindow) {
+-    return false;
+-  }
+-
 -  WindowContext* topContext =
 -      aWindow->GetBrowsingContext()->GetTopWindowContext();
 -  if (topContext && topContext->HasBeenUserGestureActivated()) {
@@ -14,7 +18,6 @@ index 77c53ce58acd..688af016a72c 100644
 -        "gesture.");
 -    return true;
 -  }
--
-   Document* currentDoc = aWindow->GetExtantDoc();
-   if (!currentDoc) {
-     return false;
+   return false;
+ }
+