-function getClipboardText() {
- var clip = Components.classes['@mozilla.org/widget/clipboard;1']
- .getService(Components.interfaces.nsIClipboard);
- if (!clip) return null;
-
- var trans = Components.classes['@mozilla.org/widget/transferable;1']
- .createInstance(Components.interfaces.nsITransferable);
- if (!trans) return null;
-
- trans.addDataFlavor("text/unicode");
- clip.getData(trans,
- clip.supportsSelectionClipboard()
- ? clip.kSelectionClipboard
- : clip.kGlobalClipboard
- );
-
- var str = new Object;
- var strLength = new Object;
- trans.getTransferData("text/unicode", str, strLength);
-
- var text = null;
-
- if (str) str = str.value.QueryInterface(Components.interfaces.nsISupportsString);
- if (str) text = str.data.substring(0, strLength.value / 2);
-
- return text;
-}
-
-function trim_keyword(word) {
- if (!word) return word;
+IceDeb = {
+ getClipboardText: function() {
+ var clip = Components.classes['@mozilla.org/widget/clipboard;1']
+ .getService(Components.interfaces.nsIClipboard);
+ if (!clip) return null;