Top.Mail.Ru
? ?
lj_dev, posts by tag: code: javascript - LiveJournal [entries|archive|friends|userinfo]
LiveJournal Development

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Security question: LJ + GreaseMonkey [Jan. 21st, 2008|03:43 pm]
LiveJournal Development

xxxxx
[Tags|]

Dear LJ developers, is it safe to include a Javascript line document.domain="livejournal.com" in a GreaseMonkey script running on all "http://*.livejournal.com/*" pages? And if not --- why exactly not?

Why do I need it?Collapse )

link7 comments|post comment

Encodings and a client [Jan. 10th, 2008|04:03 pm]
LiveJournal Development

dimrub
[Tags|, , ]

Hi, all!

I've hacked together a GreaseMonkey script that cross posts entries from Vox to LJ. Everything works fine, until I try to post Unicode stuff. It seems to go through OK (with Unicode chars encoded by the encodeURIComponent function each into something like this: %XX%XX), and the entry appears just fine in the friends list, but then I can't edit it, and I get the following when I try to:

Error
Client error: Invalid text encoding: Cannot display this post. Please see http://www.livejournal.com/support/encodings.bml for more information.

So I tried using escape() instead, which results in each Unicode char being encoded as %uXXXX instead of %XX%XX - and now the text is presented as is, in the encoded form. I also tried omitting encoding altogether (only escaping the ampersand), with the same result as with encodeURIComponent. Question is, what does LJ expect to see there exactly (and, perhaps, how to achieve it in JavaScript)?

Thanks!
link3 comments|post comment

navigation
[ viewing | most recent entries ]