/*
 * This Source Code is subject to the terms of the Mozilla Public License
 * version 2.0 (the 'License'). You can obtain a copy of the License at
 * http://mozilla.org/MPL/2.0/.
 */

self.port.on('set-video', opts => {
  opts = Object.assign(opts, {
    loaded: false,
    error: false,
    progress: 0,
    playing: false,
    volume: '0.5'
  });
  unsafeWindow.AppData = Object.assign(unsafeWindow.AppData, opts);
});

window.addEventListener('message', function(ev) {
  self.port.emit('message', ev.detail);
}, false, true);

@@ -417,16 +417,162 @@
 );%0A%7D);%0A%0A
+// Bridge between app.js window messages to the%0A// addon. We pass true for the wantsUntrusted param%0A// in order to access the message events. #82%0A
 window.a

Add comment to explain event-listener-fourth argument