On Wed, Jan 7, 2009 at 5:08 PM, Joe <[email protected]> wrote: > > Hello everyone! > > i am kind of a n00b around here, so please bear with me! I am > currently trying to develop my first ubiquity command. For this > command, i am trying to submit things to Digg. I understand that there > is already a digg command, but I am taking this on as part of my > learning process in the hopes that I can do cooler things in the > future. > > Below is my code. Can anyone tell me why it isn't working? > > CmdUtils.CreateCommand({ > name: "submit-digg", > execute: function() { > var url='http://digg.com/submit?phase=2&url=' + window.location + > '&title=' + document.title; > window.open(url, 'test') > } > }) > > > Am I completely missing the point? If so whats the problem?
Not completely, so don't worry :-) The problem is that window and document is not what you think they are - to get what you're looking for, use CmdUtils.getWindow() for window, and CmdUtils.getDocument() for document I'd also suggest that instead of using window.open(), you use Utils.openUrlInBrowser(), as this will respect the users configuration regarding opening new windows... (at least iirc) Best regards, and happy hacking cers / Christian Sonne > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ubiquity-firefox" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ubiquity-firefox?hl=en -~----------~----~----~----~------~----~------~--~---
