Bug 863515 - Add property to browser bindings to indicate whether content caused it to open. r=felipe.
authorMike Conley <mconley@mozilla.com>
Wed, 13 May 2015 16:42:20 -0400
changeset 244117 fa82c160f25964aacfad42bc3ced33543fb1c0c9
parent 244116 fcee8fe97ec8c3b526d1416be923c66a9f8ebb6a
child 244118 b8965a7ca29d2e0adedbd506b0d23ca24cb385a0
push id59841
push userkwierso@gmail.com
push dateSat, 16 May 2015 00:32:11 +0000
treeherdermozilla-inbound@c96edd321122 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs863515
milestone41.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 863515 - Add property to browser bindings to indicate whether content caused it to open. r=felipe.
toolkit/content/widgets/browser.xml
toolkit/content/widgets/remote-browser.xml
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -498,16 +498,22 @@
       </property>
 
       <property name="isSyntheticDocument">
         <getter><![CDATA[
           return this.contentDocument.mozSyntheticDocument;
         ]]></getter>
       </property>
 
+      <property name="hasContentOpener">
+        <getter><![CDATA[
+          return !!this.contentWindow.opener;
+        ]]></getter>
+      </property>
+
       <field name="mPrefs" readonly="true">
         Components.classes['@mozilla.org/preferences-service;1']
                   .getService(Components.interfaces.nsIPrefBranch);
       </field>
 
       <field name="mAtomService" readonly="true">
         Components.classes['@mozilla.org/atom-service;1']
                   .getService(Components.interfaces.nsIAtomService);
--- a/toolkit/content/widgets/remote-browser.xml
+++ b/toolkit/content/widgets/remote-browser.xml
@@ -193,16 +193,23 @@
 
       <field name="_isSyntheticDocument">false</field>
       <property name="isSyntheticDocument">
         <getter><![CDATA[
           return this._isSyntheticDocument;
         ]]></getter>
       </property>
 
+      <property name="hasContentOpener">
+        <getter><![CDATA[
+          let {frameLoader} = this.QueryInterface(Ci.nsIFrameLoaderOwner);
+          return frameLoader.tabParent.hasContentOpener;
+        ]]></getter>
+      </property>
+
       <field name="_outerWindowID">null</field>
       <property name="outerWindowID"
                 onget="return this._outerWindowID"
                 readonly="true"/>
 
       <property name="autoCompletePopup"
                 onget="return document.getElementById(this.getAttribute('autocompletepopup'))"
                 readonly="true"/>