当按下发送按钮时捕获 FB.ui() 中的发送对话框信息
Facebook 发送对话框的文档指出,'to' 参数可以包含用户 ID 或用户名。对话框出现后,用户还可以添加电子邮件地址。
有没有办法在启动时指定电子邮件地址(文档表明没有),或者是否有一个聪明的解决方法(也许通过 jQuery 进行 DOM 操作?)来插入电子邮件显示对话框后的地址?
编辑: 我已经能够将以下代码手动注入到对话框中“发送”按钮的 onclick 处理程序中:
var x=document.getElementById('feedform_user_message'); alert(x.value);
因此,现在当我单击“发送”时,警报窗口会正确显示消息文本!
后续步骤:
- 自动注入代码(也许是 jQuery?)
- 还捕获 To: 字段的内容,
- 调用 Web 服务来记录操作
The documentation for the Facebook Send Dialog states that the 'to' parameter can contain a user ID or username. Once the dialog comes up the user can also add email addresses.
Is there a way to specify an email address at startup time (documentation suggests no), or is there a clever workaround (DOM manipulation via jQuery maybe?) to insert an email address once the dialog is shown?
Edit:
I have been able to manually inject the following code into the onclick handler of the 'Send' button in the dialog:
var x=document.getElementById('feedform_user_message'); alert(x.value);
So now when I click 'Send', the alert window correctly shows me the message text!
Next steps:
- inject the code automatically (jQuery maybe?)
- also capture the contents of the To: field
- call web service to record the action
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是独立向许多用户发送 Facebook 私人消息的脚本。它对我有用。
The following is a script to send Facebook private messages into many users independently. It works with me.