Mercurial > my-ubiquity-commands
comparison chromeless-browsing/chromeless.js @ 16:426e9c04c6f9
Executing the 'where-am-i' command now copies the current URL to your clipboard.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Wed, 01 Apr 2009 12:25:48 -0700 |
parents | 8e00d50976d9 |
children |
comparison
equal
deleted
inserted
replaced
15:7ffb8a48367e | 16:426e9c04c6f9 |
---|---|
91 CmdUtils.CreateCommand({ | 91 CmdUtils.CreateCommand({ |
92 name: "where-am-i", | 92 name: "where-am-i", |
93 preview: function(pblock, dobj) { | 93 preview: function(pblock, dobj) { |
94 var loc = CmdUtils.getWindow().location; | 94 var loc = CmdUtils.getWindow().location; |
95 pblock.innerHTML = ("Your current URL is <tt>" + | 95 pblock.innerHTML = ("Your current URL is <tt>" + |
96 Utils.escapeHtml(loc.href) + "</tt>."); | 96 Utils.escapeHtml(loc.href) + "</tt>." + |
97 "<p>Press enter to copy this URL to " + | |
98 "your clipboard.</p>"); | |
99 }, | |
100 execute: function() { | |
101 var loc = CmdUtils.getWindow().location; | |
102 var clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"]. | |
103 getService(Ci.nsIClipboardHelper); | |
104 clipboard.copyString(loc.href); | |
97 } | 105 } |
98 }); | 106 }); |