Bug 1317983 - Remove navigator.mozBrowserElementProxy; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 16 Nov 2016 09:45:54 -0500
changeset 439882 326453c91392f00a0e83e82b48e67c28acc576b4
parent 439881 0f8126c38179a6475b550ed97f0dfac42c4899b6
child 439883 8ba46aa884ca52cb2e681033fbff749b26539b37
child 440059 a8212bb139a72a9ead5c9f0f93902e89ba5141a8
push id36113
push userbmo:afarre@mozilla.com
push dateWed, 16 Nov 2016 18:15:04 +0000
reviewersbaku
bugs1317983, 1196654
milestone53.0a1
Bug 1317983 - Remove navigator.mozBrowserElementProxy; r=baku This was implemented in bug 1196654 for the b2g system app, and is no longer being used.
b2g/installer/package-manifest.in
browser/installer/package-manifest.in
dom/apps/PermissionsTable.jsm
dom/browser-element/BrowserElementChildPreload.js
dom/browser-element/BrowserElementParent.js
dom/browser-element/BrowserElementProxy.js
dom/browser-element/BrowserElementProxy.manifest
dom/browser-element/mochitest/browserElement_Proxy.js
dom/browser-element/mochitest/mochitest-oop.ini
dom/browser-element/mochitest/mochitest.ini
dom/browser-element/mochitest/test_browserElement_inproc_Proxy.html
dom/browser-element/mochitest/test_browserElement_oop_Proxy.html
dom/browser-element/moz.build
dom/webidl/BrowserElementProxy.webidl
dom/webidl/moz.build
mobile/android/installer/package-manifest.in
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -326,18 +326,16 @@
 @RESPATH@/components/xultmpl.xpt
 @RESPATH@/components/zipwriter.xpt
 
 ; JavaScript components
 @RESPATH@/components/ConsoleAPI.manifest
 @RESPATH@/components/ConsoleAPIStorage.js
 @RESPATH@/components/BrowserElementParent.manifest
 @RESPATH@/components/BrowserElementParent.js
-@RESPATH@/components/BrowserElementProxy.manifest
-@RESPATH@/components/BrowserElementProxy.js
 @RESPATH@/components/PhoneNumberService.js
 @RESPATH@/components/PhoneNumberService.manifest
 @RESPATH@/components/NotificationStorage.js
 @RESPATH@/components/NotificationStorage.manifest
 @RESPATH@/components/PermissionSettings.js
 @RESPATH@/components/PermissionSettings.manifest
 @RESPATH@/components/PermissionPromptService.js
 @RESPATH@/components/PermissionPromptService.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -345,18 +345,16 @@
 @RESPATH@/components/zipwriter.xpt
 @RESPATH@/components/telemetry.xpt
 
 ; JavaScript components
 @RESPATH@/components/ConsoleAPI.manifest
 @RESPATH@/components/ConsoleAPIStorage.js
 @RESPATH@/components/BrowserElementParent.manifest
 @RESPATH@/components/BrowserElementParent.js
-@RESPATH@/components/BrowserElementProxy.manifest
-@RESPATH@/components/BrowserElementProxy.js
 @RESPATH@/components/FeedProcessor.manifest
 @RESPATH@/components/FeedProcessor.js
 @RESPATH@/components/WellKnownOpportunisticUtils.js
 @RESPATH@/components/WellKnownOpportunisticUtils.manifest
 #ifndef XP_MACOSX
 ; OSX uses native platform impl.  Windows, Linux, and Android uses fallback JS impl.
 @BINPATH@/components/nsDNSServiceDiscovery.manifest
 @BINPATH@/components/nsDNSServiceDiscovery.js
--- a/dom/apps/PermissionsTable.jsm
+++ b/dom/apps/PermissionsTable.jsm
@@ -126,21 +126,16 @@ this.PermissionsTable =  { geolocation: 
                              privileged: ALLOW_ACTION,
                              certified: ALLOW_ACTION
                            },
                            "browser:universalxss": {
                              app: DENY_ACTION,
                              privileged: ALLOW_ACTION,
                              certified: ALLOW_ACTION
                            },
-                           "browser:embedded-system-app": {
-                             app: DENY_ACTION,
-                             privileged: DENY_ACTION,
-                             certified: ALLOW_ACTION
-                           },
                            mobilenetwork: {
                              app: DENY_ACTION,
                              privileged: ALLOW_ACTION,
                              certified: ALLOW_ACTION
                            },
                            power: {
                              app: DENY_ACTION,
                              privileged: DENY_ACTION,
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -110,48 +110,16 @@ var LISTENED_SYSTEM_EVENTS = [
  * nsIMessageManager::LoadFrameScript().
  *
  * Our job here is to listen for events within this frame and bubble them up to
  * the parent process.
  */
 
 var global = this;
 
-function BrowserElementProxyForwarder() {
-}
-
-BrowserElementProxyForwarder.prototype = {
-  init: function() {
-    Services.obs.addObserver(this, "browser-element-api:proxy-call", false);
-    addMessageListener("browser-element-api:proxy", this);
-  },
-
-  uninit: function() {
-    Services.obs.removeObserver(this, "browser-element-api:proxy-call", false);
-    removeMessageListener("browser-element-api:proxy", this);
-  },
-
-  // Observer callback receives messages from BrowserElementProxy.js
-  observe: function(subject, topic, stringifedData) {
-    if (subject !== content) {
-      return;
-    }
-
-    // Forward it to BrowserElementParent.js
-    sendAsyncMessage(topic, JSON.parse(stringifedData));
-  },
-
-  // Message manager callback receives messages from BrowserElementParent.js
-  receiveMessage: function(mmMsg) {
-    // Forward it to BrowserElementProxy.js
-    Services.obs.notifyObservers(
-      content, mmMsg.name, JSON.stringify(mmMsg.json));
-  }
-};
-
 function BrowserElementChild() {
   // Maps outer window id --> weak ref to window.  Used by modal dialog code.
   this._windowIDDict = {};
 
   // _forcedVisible corresponds to the visibility state our owner has set on us
   // (via iframe.setVisible).  ownerVisible corresponds to whether the docShell
   // whose window owns this element is visible.
   //
@@ -160,18 +128,16 @@ function BrowserElementChild() {
   this._forcedVisible = true;
   this._ownerVisible = true;
 
   this._nextPaintHandler = null;
 
   this._isContentWindowCreated = false;
   this._pendingSetInputMethodActive = [];
 
-  this.forwarder = new BrowserElementProxyForwarder();
-
   this._init();
 };
 
 BrowserElementChild.prototype = {
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference]),
 
@@ -220,18 +186,16 @@ BrowserElementChild.prototype = {
                 .getService(Ci.nsIEventListenerService);
     LISTENED_SYSTEM_EVENTS.forEach(event => {
       els.addSystemEventListener(global, event.type, this, event.useCapture);
     });
 
     OBSERVED_EVENTS.forEach((aTopic) => {
       Services.obs.addObserver(this, aTopic, false);
     });
-
-    this.forwarder.init();
   },
 
   /**
    * Shut down the frame's side of the browser API.  This is called when:
    *   - our TabChildGlobal starts to die
    *   - the content is moved to frame without the browser API
    * This is not called when the page inside |content| unloads.
    */
@@ -256,19 +220,16 @@ BrowserElementChild.prototype = {
                 .getService(Ci.nsIEventListenerService);
     LISTENED_SYSTEM_EVENTS.forEach(event => {
       els.removeSystemEventListener(global, event.type, this, event.useCapture);
     });
 
     OBSERVED_EVENTS.forEach((aTopic) => {
       Services.obs.removeObserver(this, aTopic);
     });
-
-    this.forwarder.uninit();
-    this.forwarder = null;
   },
 
   handleEvent: function(event) {
     switch (event.type) {
       case "DOMTitleChanged":
         this._titleChangedHandler(event);
         break;
       case "DOMLinkAdded":
--- a/dom/browser-element/BrowserElementParent.js
+++ b/dom/browser-element/BrowserElementParent.js
@@ -55,201 +55,29 @@ function defineNoReturnMethod(fn) {
 }
 
 function defineDOMRequestMethod(msgName) {
   return function() {
     return this._sendDOMRequest(msgName);
   };
 }
 
-function BrowserElementParentProxyCallHandler() {
-}
-
-BrowserElementParentProxyCallHandler.prototype = {
-  _frameElement: null,
-  _mm: null,
-
-  MOZBROWSER_EVENT_NAMES: Object.freeze([
-    "loadstart", "loadend", "close", "error", "firstpaint",
-    "documentfirstpaint", "audioplaybackchange",
-    "contextmenu", "securitychange", "locationchange",
-    "iconchange", "scrollareachanged", "titlechange",
-    "opensearch", "manifestchange", "metachange",
-    "resize", "scrollviewchange",
-    "caretstatechanged", "activitydone", "scroll", "opentab"]),
-
-  init: function(frameElement, mm) {
-    this._frameElement = frameElement;
-    this._mm = mm;
-    this.innerWindowIDSet = new Set();
-
-    mm.addMessageListener("browser-element-api:proxy-call", this);
-  },
-
-  // Message manager callback receives messages from BrowserElementProxy.js
-  receiveMessage: function(mmMsg) {
-    let data = mmMsg.json;
-
-    let mm;
-    try {
-      mm = mmMsg.target.QueryInterface(Ci.nsIFrameLoaderOwner)
-                     .frameLoader.messageManager;
-    } catch(e) {
-      mm = mmMsg.target;
-    }
-    if (!mm.assertPermission("browser:embedded-system-app")) {
-      dump("BrowserElementParent.js: Method call " + data.methodName +
-        " from a content process with no 'browser:embedded-system-app'" +
-        " privileges.\n");
-      return;
-    }
-
-    switch (data.methodName) {
-      case '_proxyInstanceInit':
-        if (!this.innerWindowIDSet.size) {
-          this._attachEventListeners();
-        }
-        this.innerWindowIDSet.add(data.innerWindowID);
-
-        break;
-
-      case '_proxyInstanceUninit':
-        this.innerWindowIDSet.delete(data.innerWindowID);
-        if (!this.innerWindowIDSet.size) {
-          this._detachEventListeners();
-        }
-
-        break;
-
-      // void methods
-      case 'setVisible':
-      case 'setActive':
-      case 'sendMouseEvent':
-      case 'sendTouchEvent':
-      case 'goBack':
-      case 'goForward':
-      case 'reload':
-      case 'stop':
-      case 'zoom':
-      case 'findAll':
-      case 'findNext':
-      case 'clearMatch':
-      case 'mute':
-      case 'unmute':
-      case 'setVolume':
-        this._frameElement[data.methodName]
-          .apply(this._frameElement, data.args);
-
-        break;
-
-      // DOMRequest methods
-      case 'getVisible':
-      case 'download':
-      case 'purgeHistory':
-      case 'getCanGoBack':
-      case 'getCanGoForward':
-      case 'getContentDimensions':
-      case 'setInputMethodActive':
-      case 'executeScript':
-      case 'getMuted':
-      case 'getVolume':
-        let req = this._frameElement[data.methodName]
-          .apply(this._frameElement, data.args);
-        req.onsuccess = () => {
-          this._sendToProxy({
-            domRequestId: data.domRequestId,
-            innerWindowID: data.innerWindowID,
-            result: req.result
-          });
-        };
-        req.onerror = () => {
-          this._sendToProxy({
-            domRequestId: data.domRequestId,
-            innerWindowID: data.innerWindowID,
-            err: req.error
-          });
-        };
-
-        break;
-
-      // Not implemented
-      case 'getActive': // Sync ???
-      case 'addNextPaintListener': // Takes a callback
-      case 'removeNextPaintListener': // Takes a callback
-      case 'getScreenshot': // Need to pass a blob back
-        dump("BrowserElementParentProxyCallHandler Error:" +
-          "Attempt to call unimplemented method " + data.methodName + ".\n");
-        break;
-
-      default:
-        dump("BrowserElementParentProxyCallHandler Error:" +
-          "Attempt to call non-exist method " + data.methodName + ".\n");
-        break;
-    }
-  },
-
-  // Receving events from the frame element and forward it.
-  handleEvent: function(evt) {
-    // Ignore the events from nested mozbrowser iframes
-    if (evt.target !== this._frameElement) {
-      return;
-    }
-
-    let detailString;
-    try {
-      detailString = JSON.stringify(evt.detail);
-    } catch (e) {
-      dump("BrowserElementParentProxyCallHandler Error:" +
-        "Event detail of " + evt.type + " can't be stingified.\n");
-      return;
-    }
-
-    this.innerWindowIDSet.forEach((innerWindowID) => {
-      this._sendToProxy({
-        eventName: evt.type,
-        innerWindowID: innerWindowID,
-        eventDetailString: detailString
-      });
-    });
-  },
-
-  _sendToProxy: function(data) {
-    this._mm.sendAsyncMessage("browser-element-api:proxy", data);
-  },
-
-  _attachEventListeners: function() {
-    this.MOZBROWSER_EVENT_NAMES.forEach(function(eventName) {
-      this._frameElement.addEventListener(
-        "mozbrowser" + eventName, this, true);
-    }, this);
-  },
-
-  _detachEventListeners: function() {
-    this.MOZBROWSER_EVENT_NAMES.forEach(function(eventName) {
-      this._frameElement.removeEventListener(
-        "mozbrowser" + eventName, this, true);
-    }, this);
-  }
-};
-
 function BrowserElementParent() {
   debug("Creating new BrowserElementParent object");
   this._domRequestCounter = 0;
   this._domRequestReady = false;
   this._pendingAPICalls = [];
   this._pendingDOMRequests = {};
   this._pendingSetInputMethodActive = [];
   this._nextPaintListeners = [];
   this._pendingDOMFullscreen = false;
 
   Services.obs.addObserver(this, 'oop-frameloader-crashed', /* ownsWeak = */ true);
   Services.obs.addObserver(this, 'ask-children-to-execute-copypaste-command', /* ownsWeak = */ true);
   Services.obs.addObserver(this, 'back-docommand', /* ownsWeak = */ true);
-
-  this.proxyCallHandler = new BrowserElementParentProxyCallHandler();
 }
 
 BrowserElementParent.prototype = {
 
   classDescription: "BrowserElementAPI implementation",
   classID: Components.ID("{9f171ac4-0939-4ef8-b360-3408aedc3060}"),
   contractID: "@mozilla.org/dom/browser-element-api;1",
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserElementAPI,
@@ -286,19 +114,16 @@ BrowserElementParent.prototype = {
       }
     }
 
     this._window._browserElementParents.set(this, null);
 
     // Insert ourself into the prompt service.
     BrowserElementPromptService.mapFrameToBrowserElementParent(this._frameElement, this);
     this._setupMessageListener();
-
-    this.proxyCallHandler.init(
-      this._frameElement, this._frameLoader.messageManager);
   },
 
   destroyFrameScripts() {
     debug("Destroying frame scripts");
     this._mm.sendAsyncMessage("browser-element-api:destroy");
   },
 
   _runPendingAPICall: function() {
deleted file mode 100644
--- a/dom/browser-element/BrowserElementProxy.js
+++ /dev/null
@@ -1,219 +0,0 @@
-/* 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 http://mozilla.org/MPL/2.0/. */
-
-'use strict';
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
-
-function defineNoReturnMethod(methodName) {
-  return function noReturnMethod() {
-    let args = Array.slice(arguments);
-    this._sendToParent(methodName, args);
-  };
-}
-
-function defineDOMRequestMethod(methodName) {
-  return function domRequestMethod() {
-    let args = Array.slice(arguments);
-    return this._sendDOMRequest(methodName, args);
-  };
-}
-
-function defineUnimplementedMethod(methodName) {
-  return function unimplementedMethod() {
-    throw Components.Exception(
-      'Unimplemented method: ' + methodName, Cr.NS_ERROR_FAILURE);
-  };
-}
-
-/**
- * The BrowserElementProxy talks to the Browser IFrameElement instance on
- * behave of the embedded document. It implements all the methods on
- * the Browser IFrameElement and the methods will work if they are applicable.
- *
- * The message is forwarded to BrowserElementParent.js by creating an
- * 'browser-element-api:proxy-call' observer message.
- * BrowserElementChildPreload will get notified and send the message through
- * to the main process through sendAsyncMessage with message of the same name.
- *
- * The return message will follow the same route. The message name on the
- * return route is 'browser-element-api:proxy'.
- *
- * Both BrowserElementProxy and BrowserElementParent must be modified if there
- * is a new method implemented, or a new event added to the Browser
- * IFrameElement.
- *
- * Other details unmentioned here are checks of message sender and recipients
- * to identify proxy instance on different innerWindows or ensure the content
- * process has the right permission.
- */
-function BrowserElementProxy() {
-  // Pad the 0th element so that DOMRequest ID will always be a truthy value.
-  this._pendingDOMRequests = [ undefined ];
-}
-
-BrowserElementProxy.prototype = {
-  classDescription: 'BrowserElementProxy allowed embedded frame to control ' +
-                    'it\'s own embedding browser element frame instance.',
-  classID:          Components.ID('{7e95d54c-9930-49c8-9a10-44fe40fe8251}'),
-  contractID:       '@mozilla.org/dom/browser-element-proxy;1',
-
-  QueryInterface: XPCOMUtils.generateQI([
-    Ci.nsIDOMGlobalPropertyInitializer,
-    Ci.nsIObserver]),
-
-  _window: null,
-  _innerWindowID: undefined,
-
-  get allowedAudioChannels() {
-    return this._window.navigator.mozAudioChannelManager ?
-      this._window.navigator.mozAudioChannelManager.allowedAudioChannels :
-      null;
-  },
-
-  init: function(win) {
-    this._window = win;
-    this._innerWindowID = win.QueryInterface(Ci.nsIInterfaceRequestor)
-                          .getInterface(Ci.nsIDOMWindowUtils)
-                          .currentInnerWindowID;
-
-    this._sendToParent('_proxyInstanceInit');
-    Services.obs.addObserver(this, 'browser-element-api:proxy', false);
-  },
-
-  uninit: function(win) {
-    this._sendToParent('_proxyInstanceUninit');
-
-    this._window = null;
-    this._innerWindowID = undefined;
-
-    Services.obs.removeObserver(this, 'browser-element-api:proxy');
-  },
-
-  observe: function(subject, topic, stringifedData) {
-    let data = JSON.parse(stringifedData);
-
-    if (subject !== this._window ||
-        data.innerWindowID !== data.innerWindowID) {
-      return;
-    }
-
-    if (data.eventName) {
-      this._fireEvent(data.eventName, JSON.parse(data.eventDetailString));
-
-      return;
-    }
-
-    if ('domRequestId' in data) {
-      let req = this._pendingDOMRequests[data.domRequestId];
-      this._pendingDOMRequests[data.domRequestId] = undefined;
-
-      if (!req) {
-        dump('BrowserElementProxy Error: ' +
-          'Multiple observer messages for the same DOMRequest result.\n');
-        return;
-      }
-
-      if ('result' in data) {
-        let clientObj = Cu.cloneInto(data.result, this._window);
-        Services.DOMRequest.fireSuccess(req, clientObj);
-      } else {
-        let clientObj = Cu.cloneInto(data.error, this._window);
-        Services.DOMRequest.fireSuccess(req, clientObj);
-      }
-
-      return;
-    }
-
-    dump('BrowserElementProxy Error: ' +
-          'Received unhandled observer messages ' + stringifedData + '.\n');
-  },
-
-  _sendDOMRequest: function(methodName, args) {
-    let id = this._pendingDOMRequests.length;
-    let req = Services.DOMRequest.createRequest(this._window);
-
-    this._pendingDOMRequests.push(req);
-    this._sendToParent(methodName, args, id);
-
-    return req;
-  },
-
-  _sendToParent: function(methodName, args, domRequestId) {
-    let data = {
-      methodName: methodName,
-      args: args,
-      innerWindowID: this._innerWindowID
-    };
-
-    if (domRequestId) {
-      data.domRequestId = domRequestId;
-    }
-
-    Services.obs.notifyObservers(
-      this._window, 'browser-element-api:proxy-call', JSON.stringify(data));
-  },
-
-  _fireEvent: function(name, detail) {
-    let evt = this._createEvent(name, detail,
-                                /* cancelable = */ false);
-    this.__DOM_IMPL__.dispatchEvent(evt);
-  },
-
-  _createEvent: function(evtName, detail, cancelable) {
-    // This will have to change if we ever want to send a CustomEvent with null
-    // detail.  For now, it's OK.
-    if (detail !== undefined && detail !== null) {
-      detail = Cu.cloneInto(detail, this._window);
-      return new this._window.CustomEvent(evtName,
-                                          { bubbles: false,
-                                            cancelable: cancelable,
-                                            detail: detail });
-    }
-
-    return new this._window.Event(evtName,
-                                  { bubbles: false,
-                                    cancelable: cancelable });
-  },
-
-  setVisible: defineNoReturnMethod('setVisible'),
-  setActive: defineNoReturnMethod('setActive'),
-  sendMouseEvent: defineNoReturnMethod('sendMouseEvent'),
-  sendTouchEvent: defineNoReturnMethod('sendTouchEvent'),
-  goBack: defineNoReturnMethod('goBack'),
-  goForward: defineNoReturnMethod('goForward'),
-  reload: defineNoReturnMethod('reload'),
-  stop: defineNoReturnMethod('stop'),
-  zoom: defineNoReturnMethod('zoom'),
-  findAll: defineNoReturnMethod('findAll'),
-  findNext: defineNoReturnMethod('findNext'),
-  clearMatch: defineNoReturnMethod('clearMatch'),
-  mute: defineNoReturnMethod('mute'),
-  unmute: defineNoReturnMethod('unmute'),
-  setVolume: defineNoReturnMethod('setVolume'),
-
-  getVisible: defineDOMRequestMethod('getVisible'),
-  download: defineDOMRequestMethod('download'),
-  purgeHistory: defineDOMRequestMethod('purgeHistory'),
-  getCanGoBack: defineDOMRequestMethod('getCanGoBack'),
-  getCanGoForward: defineDOMRequestMethod('getCanGoForward'),
-  getContentDimensions: defineDOMRequestMethod('getContentDimensions'),
-  setInputMethodActive: defineDOMRequestMethod('setInputMethodActive'),
-  executeScript: defineDOMRequestMethod('executeScript'),
-  getMuted: defineDOMRequestMethod('getMuted'),
-  getVolume: defineDOMRequestMethod('getVolume'),
-
-  getActive: defineUnimplementedMethod('getActive'),
-  addNextPaintListener: defineUnimplementedMethod('addNextPaintListener'),
-  removeNextPaintListener: defineUnimplementedMethod('removeNextPaintListener'),
-  getScreenshot: defineUnimplementedMethod('getScreenshot')
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserElementProxy]);
deleted file mode 100644
--- a/dom/browser-element/BrowserElementProxy.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {7e95d54c-9930-49c8-9a10-44fe40fe8251} BrowserElementProxy.js
-contract @mozilla.org/dom/browser-element-proxy;1 {7e95d54c-9930-49c8-9a10-44fe40fe8251}
deleted file mode 100644
--- a/dom/browser-element/mochitest/browserElement_Proxy.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Any copyright is dedicated to the public domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-browserElementTestHelpers.addPermission();
-
-function runTest() {
-  let frameUrl = SimpleTest.getTestFileURL('/file_empty.html');
-  SpecialPowers.pushPermissions([{
-    type: 'browser:embedded-system-app',
-    allow: true,
-    context: {
-      url: frameUrl,
-      originAttributes: {
-        inIsolatedMozBrowser: true
-      }
-    }
-  },{
-    type: 'browser',
-    allow: true,
-    context: {
-      url: frameUrl,
-      originAttributes: {
-        inIsolatedMozBrowser: true
-      }
-    }
-  }], createFrame);
-}
-
-var frame;
-var mm;
-
-function createFrame() {
-  let loadEnd = function() {
-    // The frame script running in the frame where the input is hosted.
-    let appFrameScript = function appFrameScript() {
-      let i = 1;
-
-      addMessageListener('test:next', function() {
-        try {
-          switch (i) {
-            case 1:
-              content.document.addEventListener(
-                'visibilitychange', function fn() {
-                content.document.removeEventListener('visibilitychange', fn);
-                sendAsyncMessage('test:done', {
-                  ok: true,
-                  msg: 'setVisible()'
-                });
-              });
-
-              // Test a no return method
-              content.navigator.mozBrowserElementProxy.setVisible(false);
-
-              break;
-            case 2:
-              // Test a DOMRequest method
-              var req = content.navigator.mozBrowserElementProxy.getVisible();
-              req.onsuccess = function() {
-                sendAsyncMessage('test:done', {
-                  ok: true,
-                  msg: 'getVisible()'
-                });
-              };
-
-              req.onerror = function() {
-                sendAsyncMessage('test:done', {
-                  ok: false,
-                  msg: 'getVisible() DOMRequest return error.'
-                });
-              };
-
-              break;
-            case 3:
-              // Test an unimplemented method
-              try {
-                content.navigator.mozBrowserElementProxy.getActive();
-                sendAsyncMessage('test:done', {
-                  ok: false,
-                  msg: 'getActive() should throw.'
-                });
-
-              } catch (e) {
-                sendAsyncMessage('test:done', {
-                  ok: true,
-                  msg: 'getActive() throws.'
-                });
-              }
-
-              break;
-            case 4:
-              content.navigator.mozBrowserElementProxy
-              .addEventListener(
-                'mozbrowserlocationchange',
-                function() {
-                  content.navigator.mozBrowserElementProxy
-                    .onmozbrowserlocationchange = null;
-
-                  sendAsyncMessage('test:done', {
-                    ok: true,
-                    msg: 'mozbrowserlocationchange'
-                  });
-              });
-
-              // Test event
-              content.location.hash = '#foo';
-
-              break;
-          }
-        } catch (e) {
-          sendAsyncMessage('test:done', {
-            ok: false, msg: 'thrown: ' + e.toString() });
-        }
-
-        i++;
-      });
-
-      sendAsyncMessage('test:done', {});
-    }
-
-    mm = SpecialPowers.getBrowserFrameMessageManager(frame);
-    mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
-    mm.addMessageListener("test:done", next);
-  };
-
-  frame = document.createElement('iframe');
-  frame.setAttribute('mozbrowser', 'true');
-  frame.src = 'file_empty.html';
-  document.body.appendChild(frame);
-  frame.addEventListener('mozbrowserloadend', loadEnd);
-}
-
-var i = 0;
-function next(msg) {
-  let wrappedMsg = SpecialPowers.wrap(msg);
-  let isOK = wrappedMsg.data.ok;
-  let msgString = wrappedMsg.data.msg;
-
-  switch (i) {
-    case 0:
-      mm.sendAsyncMessage('test:next');
-      break;
-
-    case 1:
-    case 2:
-    case 3:
-      ok(isOK, msgString);
-      mm.sendAsyncMessage('test:next');
-      break;
-
-    case 4:
-      ok(isOK, msgString);
-      SimpleTest.finish();
-      break;
-  }
-
-  i++;
-}
-
-addEventListener('testready', runTest);
--- a/dom/browser-element/mochitest/mochitest-oop.ini
+++ b/dom/browser-element/mochitest/mochitest-oop.ini
@@ -68,17 +68,16 @@ disabled = disabled for bug 1266035
 [test_browserElement_oop_OpenWindowInFrame.html]
 [test_browserElement_oop_OpenWindowRejected.html]
 [test_browserElement_oop_Opensearch.html]
 [test_browserElement_oop_OpenTab.html]
 disabled = Disabling some OOP tests for WebIDL scope changes
 [test_browserElement_oop_PrivateBrowsing.html]
 [test_browserElement_oop_PromptCheck.html]
 [test_browserElement_oop_PromptConfirm.html]
-[test_browserElement_oop_Proxy.html]
 [test_browserElement_oop_PurgeHistory.html]
 disabled = Disabling some OOP tests for WebIDL scope changes
 [test_browserElement_oop_Reload.html]
 disabled = Disabling some OOP tests for WebIDL scope changes
 [test_browserElement_oop_ReloadPostRequest.html]
 disabled = Disabling some OOP tests for WebIDL scope changes
 [test_browserElement_oop_RemoveBrowserElement.html]
 [test_browserElement_oop_ScrollEvent.html]
--- a/dom/browser-element/mochitest/mochitest.ini
+++ b/dom/browser-element/mochitest/mochitest.ini
@@ -35,17 +35,16 @@ support-files =
   browserElement_OpenWindowDifferentOrigin.js
   browserElement_OpenWindowEmpty.js
   browserElement_OpenWindowInFrame.js
   browserElement_OpenWindowRejected.js
   browserElement_Opensearch.js
   browserElement_PrivateBrowsing.js
   browserElement_PromptCheck.js
   browserElement_PromptConfirm.js
-  browserElement_Proxy.js
   browserElement_Reload.js
   browserElement_RemoveBrowserElement.js
   browserElement_ScrollEvent.js
   browserElement_SecurityChange.js
   browserElement_TargetBlank.js
   browserElement_TargetTop.js
   browserElement_Titlechange.js
   browserElement_TopBarrier.js
@@ -134,17 +133,16 @@ disabled = won't work as Firefox desktop
 [test_browserElement_inproc_OpenWindow.html]
 [test_browserElement_inproc_OpenWindowDifferentOrigin.html]
 [test_browserElement_inproc_OpenWindowInFrame.html]
 [test_browserElement_inproc_OpenWindowRejected.html]
 [test_browserElement_inproc_Opensearch.html]
 [test_browserElement_inproc_PrivateBrowsing.html]
 [test_browserElement_inproc_PromptCheck.html]
 [test_browserElement_inproc_PromptConfirm.html]
-[test_browserElement_inproc_Proxy.html]
 [test_browserElement_inproc_RemoveBrowserElement.html]
 [test_browserElement_inproc_ScrollEvent.html]
 [test_browserElement_inproc_SecurityChange.html]
 [test_browserElement_inproc_TargetBlank.html]
 [test_browserElement_inproc_TargetTop.html]
 [test_browserElement_inproc_Titlechange.html]
 [test_browserElement_inproc_TopBarrier.html]
 [test_browserElement_inproc_XFrameOptions.html]
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_inproc_Proxy.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1196654
--->
-<head>
-  <title>Test for Bug 1196654</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1196654">Mozilla Bug 1196654</a>
-
-<script type="application/javascript;version=1.7" src="browserElement_Proxy.js">
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_oop_Proxy.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1196654
--->
-<head>
-  <title>Test for Bug 1196654</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1196654">Mozilla Bug 1196654</a>
-
-<script type="application/javascript;version=1.7" src="browserElement_Proxy.js">
-</script>
-</body>
-</html>
--- a/dom/browser-element/moz.build
+++ b/dom/browser-element/moz.build
@@ -21,18 +21,16 @@ XPIDL_SOURCES += [
     'nsIBrowserElementAPI.idl',
 ]
 
 XPIDL_MODULE = 'browser-element'
 
 EXTRA_COMPONENTS += [
     'BrowserElementParent.js',
     'BrowserElementParent.manifest',
-    'BrowserElementProxy.js',
-    'BrowserElementProxy.manifest',
 ]
 
 EXTRA_JS_MODULES += [
     'BrowserElementPromptService.jsm',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/html',
deleted file mode 100644
--- a/dom/webidl/BrowserElementProxy.webidl
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 http://mozilla.org/MPL/2.0/.
- */
-
-[Constructor,
- JSImplementation="@mozilla.org/dom/browser-element-proxy;1",
- NavigatorProperty="mozBrowserElementProxy",
- Pref="dom.mozBrowserFramesEnabled",
- ChromeOnly]
-interface BrowserElementProxy : EventTarget {
-};
-BrowserElementProxy implements BrowserElementCommon;
-BrowserElementProxy implements BrowserElementPrivileged;
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -54,17 +54,16 @@ WEBIDL_FILES = [
     'BeforeUnloadEvent.webidl',
     'BiquadFilterNode.webidl',
     'Blob.webidl',
     'BoxObject.webidl',
     'BroadcastChannel.webidl',
     'BrowserElement.webidl',
     'BrowserElementAudioChannel.webidl',
     'BrowserElementDictionaries.webidl',
-    'BrowserElementProxy.webidl',
     'Cache.webidl',
     'CacheStorage.webidl',
     'CanvasCaptureMediaStream.webidl',
     'CanvasRenderingContext2D.webidl',
     'CaretPosition.webidl',
     'CDATASection.webidl',
     'ChannelMergerNode.webidl',
     'ChannelSplitterNode.webidl',
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -272,18 +272,16 @@
 @BINPATH@/components/Push.js
 @BINPATH@/components/Push.manifest
 @BINPATH@/components/PushComponents.js
 #endif
 @BINPATH@/components/SettingsManager.js
 @BINPATH@/components/SettingsManager.manifest
 @BINPATH@/components/BrowserElementParent.manifest
 @BINPATH@/components/BrowserElementParent.js
-@BINPATH@/components/BrowserElementProxy.manifest
-@BINPATH@/components/BrowserElementProxy.js
 @BINPATH@/components/FeedProcessor.manifest
 @BINPATH@/components/FeedProcessor.js
 @BINPATH@/components/WellKnownOpportunisticUtils.js
 @BINPATH@/components/WellKnownOpportunisticUtils.manifest
 @BINPATH@/components/PermissionSettings.js
 @BINPATH@/components/PermissionSettings.manifest
 @BINPATH@/components/PermissionPromptService.js
 @BINPATH@/components/PermissionPromptService.manifest