<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mozilla.org/index.php?action=history&amp;feed=atom&amp;title=Electrolysis%2FBrowserBinding</id>
	<title>Electrolysis/BrowserBinding - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mozilla.org/index.php?action=history&amp;feed=atom&amp;title=Electrolysis%2FBrowserBinding"/>
	<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Electrolysis/BrowserBinding&amp;action=history"/>
	<updated>2026-09-28T16:31:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Electrolysis/BrowserBinding&amp;diff=218079&amp;oldid=prev</id>
		<title>MarkFinkle: Created page with &#039;XUL applications use the &lt;code&gt;&lt;browser&gt;&lt;/code&gt; to create a browse-able web content widget. The &lt;code&gt;&lt;browser&gt;&lt;/code&gt; XBL [http://mxr.mozilla.org/mozilla-central/source/toolkit/…&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Electrolysis/BrowserBinding&amp;diff=218079&amp;oldid=prev"/>
		<updated>2010-04-23T19:00:03Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;XUL applications use the &amp;lt;code&amp;gt;&amp;lt;browser&amp;gt;&amp;lt;/code&amp;gt; to create a browse-able web content widget. The &amp;lt;code&amp;gt;&amp;lt;browser&amp;gt;&amp;lt;/code&amp;gt; XBL [http://mxr.mozilla.org/mozilla-central/source/toolkit/…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;XUL applications use the &amp;lt;code&amp;gt;&amp;lt;browser&amp;gt;&amp;lt;/code&amp;gt; to create a browse-able web content widget. The &amp;lt;code&amp;gt;&amp;lt;browser&amp;gt;&amp;lt;/code&amp;gt; XBL [http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/browser.xml binding] exposes many useful properties.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
In the world of Electrolysis, a browser enables out-of-process web content using the &amp;lt;code&amp;gt;remote&amp;lt;/code&amp;gt; attribute:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;browser remote=&amp;quot;true&amp;quot; ... /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Out-of-process web content breaks many of the XBL properties. The DocShell is not valid so many of the core properties fail: &amp;lt;code&amp;gt;webNavigation&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;webProgress&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;contentWindow&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;contentDocument&amp;lt;/code&amp;gt;. These properties make up the foundation of many other properties as well.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
&lt;br /&gt;
We can create an IPC-aware XBL binding, which extends the current &amp;lt;code&amp;gt;&amp;lt;browser&amp;gt;&amp;lt;/code&amp;gt; binding. The goal would be to override as many properties as possible, so the properties either work - or throw errors. We should not silently fail or cause errors far from the root cause.&lt;br /&gt;
&lt;br /&gt;
The IPC-aware XBL binding would live in the same XBL file the current non-IPC binding lives. We can use the &amp;lt;code&amp;gt;remote&amp;lt;/code&amp;gt; attribute to enable the IPC-aware binding.&lt;br /&gt;
&lt;br /&gt;
==The Plan==&lt;br /&gt;
&lt;br /&gt;
The IPC-aware binding would use a content process script, loaded in its constructor using &amp;lt;code&amp;gt;messageManager&amp;lt;/code&amp;gt;. The content process script would setup some utility code that would send or receive messages from the chrome XBL binding.&lt;br /&gt;
&lt;br /&gt;
Some examples of content script helpers include:&lt;br /&gt;
* WebProgress: Used to send the current URI from LocationChange which the XBL uses to implement &amp;lt;code&amp;gt;currentURI&amp;lt;/code&amp;gt;. Also used to update the &amp;lt;code&amp;gt;canGoBack&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;canGoForward&amp;lt;/code&amp;gt; properties.&lt;br /&gt;
* DOMEvents: Used to listen for some DOM events, like DOMTitleChanged, and send a message back to chrome XBL. The XBL then uses the data, setting &amp;lt;code&amp;gt;contentTitle&amp;lt;/code&amp;gt; for example, and then also re-dispatches the DOM event into chrome.&lt;br /&gt;
* WebNavigation: Used by the XBL to implement nsIWebNaviagtion-based methods like &amp;lt;code&amp;gt;goBack&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;goForward&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadURI&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reload&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The current work is happening in {{bug|560827}}.&lt;/div&gt;</summary>
		<author><name>MarkFinkle</name></author>
	</entry>
</feed>