# HG changeset patch # User Atul Varma # Date 1238613948 25200 # Node ID 426e9c04c6f99bf97ea787eb1aceb6055f27c59a # Parent 7ffb8a48367ee3925b506483e2a4bb8acbd008d3 Executing the 'where-am-i' command now copies the current URL to your clipboard. diff -r 7ffb8a48367e -r 426e9c04c6f9 chromeless-browsing/chromeless.js --- a/chromeless-browsing/chromeless.js Wed Apr 01 09:21:54 2009 -0700 +++ b/chromeless-browsing/chromeless.js Wed Apr 01 12:25:48 2009 -0700 @@ -93,6 +93,14 @@ preview: function(pblock, dobj) { var loc = CmdUtils.getWindow().location; pblock.innerHTML = ("Your current URL is " + - Utils.escapeHtml(loc.href) + "."); + Utils.escapeHtml(loc.href) + "." + + "

Press enter to copy this URL to " + + "your clipboard.

"); + }, + execute: function() { + var loc = CmdUtils.getWindow().location; + var clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"]. + getService(Ci.nsIClipboardHelper); + clipboard.copyString(loc.href); } });