<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.developerfriendly.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>webrunner</title>
 <link>http://www.developerfriendly.com/taxonomy/term/12</link>
 <description>The taxonomy view with a depth of 0.</description>
 <language>en</language>
<item>
 <title>Customizing WebRunner Behavior</title>
 <link>http://www.developerfriendly.com/node/37</link>
 <description>&lt;p&gt;I would like to share a technique that I am using to customize WebRunner&#039;s behavior without directly changing the source code.   In my AppRunner extension I have created an overlay for webrunner.xul and within the overlay I include my custom apprunner.js script. Today I decided that I want to modify the behavior of a function in the core WebRunner application object.&lt;/p&gt;

&lt;p&gt;In webrunner.js there is a global WebRunner object which is defined like this:&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;
var WebRunner = {
   _profile : null,
   _ios : null,

   //  webrunner functions omitted...

}
&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
In my apprunner.js file I have my own global AppRunner namespace object, defined similarly to the WebRunner object above.  I will try to let the code speak for it&#039;s self with a short explanation afterward:
&lt;/p&gt;

&lt;code&gt;&lt;pre style=&#039;overflow:scroll;height:400px&#039;&gt;
window.addEventListener(&quot;load&quot;, function() { apprunner.startup(); }, false);
window.addEventListener(&quot;unload&quot;, function() { apprunner.shutdown(); }, false);
var apprunner = {
	startup: function() {
		self = this;
		var browserContext = document.getElementById(&quot;popup_main&quot;);
		browserContext.addEventListener(&quot;popupshowing&quot;, self._popupShowing, false);
		&lt;strong&gt;
		//replace the webrunner _isLinkExternal function with a modified version:
		WebRunner._isLinkExternal = this._isLinkExternal;
               &lt;/strong&gt;
	},
	shutdown: function() {
		self = this;
		window.removeEventListener(&quot;popupshowing&quot;,self._popupShowing, false);
	},
	_popupShowing: function(aEvent) {
		var isAnchor = (document.popupNode instanceof HTMLAnchorElement);
		document.getElementById(&quot;menuitem_copylink&quot;).setAttribute(&quot;hidden&quot;,!isAnchor);
		document.getElementById(&quot;link_popup_separator&quot;).setAttribute(&quot;hidden&quot;,!isAnchor);
	},
	_isLinkExternal : function(aLink) {
		if (aLink instanceof HTMLAnchorElement) {
		  if (aLink.target == &quot;_self&quot; || aLink.target == &quot;_top&quot;)
			return false;
		  
		  var currentURL = this._ios.newURI(aLink.href, null, null).QueryInterface(Ci.nsIURL);
		  var commonBase = currentURL.getCommonBaseSpec(this._getBrowser().currentURI);
		  //alert(commonBase + &quot;:&quot; + aLink.href + &quot;:&quot; + this._getBrowser().currentURI.href);
		  return (commonBase.length == 0);
		}
		return true;
	},
	copylink: function(event) {
		var gClipboardHelper = Components.classes[&quot;@mozilla.org/widget/clipboardhelper;1&quot;].
                                getService(Components.interfaces.nsIClipboardHelper);
		gClipboardHelper.copyString(document.popupNode.href);
	},
	doCommand : function(aCmd) {
	    switch (aCmd) {
	      case &quot;cmd_aboutconfig&quot;:
	        window.open(&quot;chrome://global/content/config.xul&quot;, &quot;About:Config&quot;, &quot;chrome,extrachrome,dependent,menubar,resizable,scrollbars,status,toolbar&quot;);
	        break;
		}
	}
}
&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;
 The code above is mostly for other functionality that I have added in my webrunner extension, however, the startup function shows the technique which I wanted to highlight. Notice the bold face code which replaces a function in WebRunner with my own version of the same function.  This doesn&#039;t have much effect right now because I have not rewritten the function to my liking, however, my changes to that function will override WebRunner&#039;s version of the same function, all without touching webrunner.js or webrunner.xul.
&lt;/p&gt;

&lt;p&gt;
This is the beauty of Mozilla&#039;s platform for extensibility and the flexibility of JavaScript makes it even more powerful. This is incredible extensibility due to the simple and intelligent design of the Mozilla platform in general and WebRunner in particular.
&lt;/p&gt;</description>
 <comments>http://www.developerfriendly.com/node/37#comments</comments>
 <category domain="http://www.developerfriendly.com/taxonomy/term/1">mozpad</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/12">webrunner</category>
 <pubDate>Thu, 06 Sep 2007 22:44:29 -0500</pubDate>
 <dc:creator>20after4</dc:creator>
 <guid isPermaLink="false">37 at http://www.developerfriendly.com</guid>
</item>
<item>
 <title>A simple extension for WebRunner</title>
 <link>http://www.developerfriendly.com/node/33</link>
 <description>&lt;br/&gt;
&lt;p&gt;
Today I created a simple extension for WebRunner. I believe that this will only work with the latest SVN version from &lt;a href=&quot;http://svn.mozilla.org/projects/webrunner/&quot;&gt;svn.mozilla.org&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
To install, unzip the file into the extensions folder inside your webrunner profile.  On Linux it&#039;s in &lt;em&gt;~/.webrunner/XXXX/extensions&lt;/em&gt; (Where XXXX is a randomly generated name) 
&lt;/p&gt;

&lt;h3&gt;Currently implemented features:&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Adds &quot;Copy link location&quot; to the context menu for links.&lt;/li&gt;
  &lt;li&gt;Adds an About:Config option to the webrunner application menu.&lt;/li&gt;
  &lt;li&gt;Adds basic security feedback UI: simple status icons indicate secure/insecure states&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;
Icons come from the &lt;a href=&quot;http://www.famfamfam.com/lab/icons/silk/&quot;&gt;Silk&lt;/a&gt; icon set at famfamfam.com.
&lt;/p&gt;

More to come...
&lt;p&gt;
&lt;strong&gt;Update:&lt;/strong&gt; Tonight I created a gtalk.webapp which makes Webrunner use the Google Talk widget (Flash required)  - the file is attached below for anyone who might be interested.&lt;/p&gt;</description>
 <comments>http://www.developerfriendly.com/node/33#comments</comments>
 <category domain="http://www.developerfriendly.com/taxonomy/term/12">webrunner</category>
 <enclosure url="http://www.developerfriendly.com/files/apprunner.zip" length="5900" type="application/zip" />
 <pubDate>Mon, 13 Aug 2007 16:02:42 -0500</pubDate>
 <dc:creator>20after4</dc:creator>
 <guid isPermaLink="false">33 at http://www.developerfriendly.com</guid>
</item>
<item>
 <title>Using WebRunner with docs.google.com</title>
 <link>http://www.developerfriendly.com/node/32</link>
 <description>A while back I noticed a problem with using WebRunner on Google Docs and Spreadsheets. When you log in to docs.google.com you get an interface for browsing your documents, however, WebRunner launches any opened documents in an external browser window. This is not the desired behavior - I want my documents to open inside of WebRunner. it turns out to be fairly easy to fix this behavior in WebRunner so I modified the source to make documents load in the same window instead of launching Firefox.

This could have some side effects but for now it&#039;s working for my purposes. I have attached a diff between my version of webrunner.js and the file from Mark Finkle&#039;s version 0.5 release. Try it out if you like and let me know how if you run into any problems. I&#039;d like to see this get integrated into the next version of WebRunner if there are not any negative side effects from my changes.</description>
 <comments>http://www.developerfriendly.com/node/32#comments</comments>
 <category domain="http://www.developerfriendly.com/taxonomy/term/12">webrunner</category>
 <enclosure url="http://www.developerfriendly.com/files/webrunner.js.diff" length="1909" type="text/x-patch" />
 <pubDate>Sun, 12 Aug 2007 01:02:30 -0500</pubDate>
 <dc:creator>20after4</dc:creator>
 <guid isPermaLink="false">32 at http://www.developerfriendly.com</guid>
</item>
<item>
 <title>Adding some advanced features to WebRunner</title>
 <link>http://www.developerfriendly.com/node/17</link>
 <description>&lt;br/&gt;
This is a quick and dirty copy-paste hack to get Password Manager and &quot;about:config&quot; functionality in webrunner 0.5:
&lt;!--break--&gt;
You will need to modify two files in the chrome/content directory as follows... Inside the statusbar tag in webrunner.xul (line 51) add the following:

&lt;pre&gt;
 &amp;lt;statusbarpanel id=&quot;statusbar-tools&quot; label=&quot;&quot;&gt;
    &amp;lt;toolbarbutton type=&quot;menu&quot;&gt;
        &amp;lt;menupopup id=&quot;tools-popup&quot;&gt;
            &amp;lt;menuitem id=&#039;menu_config&#039; label=&#039;Advanced Config&#039; oncommand=&quot;menuCommand(&#039;cmd_config&#039;);&quot;/&gt;
            &amp;lt;menuitem id=&#039;menu_passwordmanager&#039; label=&#039;Password Manager&#039; oncommand=&quot;menuCommand(&#039;cmd_passwordmanager&#039;);&quot;/&gt;
            &amp;lt;menuitem id=&#039;menu_jsconsole&#039; label=&#039;JavaScript Console&#039; oncommand=&quot;menuCommand(&#039;cmd_jsconsole&#039;);&quot;/&gt;
        &amp;lt;/menupopup&gt;
    &amp;lt;/toolbarbutton&gt;
  &amp;lt;/statusbarpanel&gt;
&lt;/pre&gt;

And add this to the end of webrunner.js:

&lt;pre&gt;
/* advanced tools menu handler added by Mukunda Modell */
function menuCommand(cmd) {
	var winUrl;
	var features;
	if(cmd == &#039;cmd_config&#039;) {
		//show about:config (Advanced config)
		winUrl = &quot;chrome://global/content/config.xul&quot;;
		features = &quot;chrome,statusbar=yes,titlebar=yes,centerscreen,close=yes,modal=yes&quot;;
		window.open(winUrl,&quot;About:Config&quot;,features);
	} else if (cmd == &#039;cmd_passwordmanager&#039;) {
		//show Password Manager dialog
		winUrl = &quot;chrome://passwordmgr/content/passwordManager.xul&quot;;
		features = &quot;chrome,statusbar=yes,titlebar=yes,close=yes,modal=yes&quot;;
		window.open(winUrl,&quot;About:Config&quot;,features);
	} else if (cmd == &#039;cmd_pref&#039;) {
		winUrl = &quot;chrome://webrunner/content/prefs.xul&quot;;
		features = &quot;chrome,titlebar,toolbar,centerscreen,modal&quot;;
		window.openDialog(winUrl, &quot;Preferences&quot;, features);
	} else if (cmd == &#039;cmd_jsconsole&#039;) {
		toJavaScriptConsole();
	}
}
&lt;/pre&gt;

Note: there is code to support JavaScript console, however, this is not working for me on Linux with the latest nightly builds of xulrunner. It should work on OS X though it might just be an issue with the default preferences. I will post an update here when I get it figured out.  Enjoy!</description>
 <comments>http://www.developerfriendly.com/node/17#comments</comments>
 <category domain="http://www.developerfriendly.com/taxonomy/term/1">mozpad</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/12">webrunner</category>
 <pubDate>Sat, 14 Jul 2007 05:49:29 -0500</pubDate>
 <dc:creator>20after4</dc:creator>
 <guid isPermaLink="false">17 at http://www.developerfriendly.com</guid>
</item>
<item>
 <title>WebRunnerX</title>
 <link>http://www.developerfriendly.com/WebRunnerX</link>
 <description>WebRunnerX is a version of &lt;a href=&quot;http://starkravingfinkle.org/blog/2007/07/webrunner-05-now-with-more-power/&quot;&gt;WebRunner&lt;/a&gt; that has been packaged for Mac OS X. See &lt;a href=&quot;/node/9&quot;&gt;this post&lt;/a&gt; for details.

&lt;strong&gt;Note:&lt;/strong&gt; Mark Finkle just released a &lt;a href=&quot;http://starkravingfinkle.org/blog/2007/07/webrunner-05-now-with-more-power/&quot;&gt;new version&lt;/a&gt; of WebRunner. I will be updating WebRunnerX to this latest version as soon as I can get some free time to work on it...

&lt;h4&gt;Update: WebRunnerX 0.5 uploaded&lt;/h4&gt;

&lt;h4&gt;Update #2:&lt;/h4&gt; Mozilla has renamed WebRunner to &quot;Prism&quot; and they are now supporting a Mac OS X version. You should definitely use Prism instead of my outdated version of WebRunner!  Check out the wiki at &lt;a href=&quot;http://wiki.mozilla.org/WebRunner&quot;&gt;http://wiki.mozilla.org/WebRunner&lt;/a&gt;</description>
 <comments>http://www.developerfriendly.com/WebRunnerX#comments</comments>
 <category domain="http://www.developerfriendly.com/taxonomy/term/37">OS X</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/38">projects</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/12">webrunner</category>
 <enclosure url="http://www.developerfriendly.com/files/WebRunnerX-v05.dmg.zip" length="372265" type="application/x-zip-compressed" />
 <pubDate>Tue, 10 Jul 2007 14:34:57 -0500</pubDate>
 <dc:creator>20after4</dc:creator>
 <guid isPermaLink="false">16 at http://www.developerfriendly.com</guid>
</item>
<item>
 <title>WebRunner 0.3 packaged as a Mac OS X App Bundle</title>
 <link>http://www.developerfriendly.com/node/9</link>
 <description>&lt;p&gt;				Tonight I threw together a Mac OS X package based on Mark Finkle&#039;s &quot;&lt;a href=&quot;http://starkravingfinkle.org/blog/2007/03/site-specific-browser-using-webrunner/&quot;&gt;WebRunner&lt;/a&gt;&quot; code (Version 0.3.)&lt;/p&gt;&lt;p&gt;Everything looks good on my G4 PowerMac but I don&#039;t have any other environment to test this with. I believe that it requires &lt;strike&gt;XULRunner 1.8.1.3&lt;/strike&gt; &lt;a href=&quot;http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/xulrunner-1.9a7pre.en-US.mac-pkg.dmg&quot;&gt;XULRunner 1.9a7pre&lt;/a&gt; to be installed in the default location (/Library/Frameworks/XUL.Framework/) though another version might work.&lt;/p&gt;&lt;p&gt;I would appreciate any feedback on this as I have minimal experience with MacOS packaging. I intend to use this experience as the basis for a tutorial on &lt;a href=&quot;http://developer.mozilla.org&quot;&gt;MDC&lt;/a&gt; and the finished app bundle will make a nice example for other developers to learn from.&lt;/p&gt;&lt;p&gt;If you manage to test this please let me know whether it worked along with the versions of XULRunner and OS X that you tested. Thanks in advance for any feedback you can provide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I created an icon that you might like to use for webrunner, however, I can imagine using several instances of webrunner for several different webapps. In that case it would be really cool if there were a way to generate a custom version of the icon for each unique webrunner application. More on this idea later.....
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt; I am writing up an article with details of how this was done. You can read what I have so far over &lt;a href=&quot;http://developer.mozilla.org/en/docs/XULRunner:Creating_custom_app_bundles_for_Mac_OS_X&quot;&gt;here&lt;/a&gt; on the Mozilla Developer Center wiki.
&lt;!--break--&gt;

&lt;p&gt;&lt;strong&gt;Update 3:&lt;/strong&gt; New version: &lt;a href=&quot;/WebRunnerX&quot;&gt;here&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.developerfriendly.com/node/9#comments</comments>
 <category domain="http://www.developerfriendly.com/taxonomy/term/1">mozpad</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/13">osx</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/14">packaging</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/12">webrunner</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/8">XULRunner</category>
 <enclosure url="http://www.developerfriendly.com/files/WebRunnerX.dmg.zip" length="289052" type="application/zip" />
 <pubDate>Sat, 16 Jun 2007 03:05:29 -0500</pubDate>
 <dc:creator>20after4</dc:creator>
 <guid isPermaLink="false">9 at http://www.developerfriendly.com</guid>
</item>
</channel>
</rss>
