Bug 1535444 - Update MozTogglePictureInPicture actor definition. r=Felipe
authorMike Conley <mconley@mozilla.com>
Thu, 14 Mar 2019 20:51:02 +0000
changeset 521962 afb5f4cea791
parent 521961 87ea67b789a3
child 521963 1d23b016870a
push id10870
push usernbeleuzu@mozilla.com
push dateFri, 15 Mar 2019 20:00:07 +0000
treeherdermozilla-beta@c594aee5b7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1535444
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1535444 - Update MozTogglePictureInPicture actor definition. r=Felipe Differential Revision: https://phabricator.services.mozilla.com/D23579
toolkit/actors/PictureInPictureChild.jsm
toolkit/modules/ActorManagerParent.jsm
--- a/toolkit/actors/PictureInPictureChild.jsm
+++ b/toolkit/actors/PictureInPictureChild.jsm
@@ -9,17 +9,19 @@ var EXPORTED_SYMBOLS = ["PictureInPictur
 const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
 
 var gWeakVideo = null;
 
 class PictureInPictureChild extends ActorChild {
   handleEvent(event) {
     switch (event.type) {
       case "MozTogglePictureInPicture": {
-        this.togglePictureInPicture(event.target);
+        if (event.isTrusted) {
+          this.togglePictureInPicture(event.target);
+        }
         break;
       }
     }
   }
 
   togglePictureInPicture(video) {
     if (this.inPictureInPicture(video)) {
       this.closePictureInPicture(video);
--- a/toolkit/modules/ActorManagerParent.jsm
+++ b/toolkit/modules/ActorManagerParent.jsm
@@ -348,17 +348,17 @@ let ACTORS = {
   },
 };
 
 if (AppConstants.NIGHTLY_BUILD) {
   ACTORS.PictureInPicture = {
     child: {
       module: "resource://gre/actors/PictureInPictureChild.jsm",
       events: {
-        "MozTogglePictureInPicture": {capture: true, wantUntrusted: true},
+        "MozTogglePictureInPicture": {capture: true},
       },
 
       messages: [
         "PictureInPicture:SetupPlayer",
       ],
     },
   };
 }