如何将信息从 AppEngine 传递到 Chrome 扩展程序
我有一个 Chrome 扩展程序,它使用 AppEngine 作为后端,并使用 Google 帐户进行身份验证。该扩展程序每 15 分钟弹出一次通知,并将结果存储在 AppEngine 中。每当弹出通知时,我想检查以确保用户已登录。如果他们没有登录,那么我会在 AppEngine 中打开一个页面供他们登录。
然后我想有一种方法让 AppEngine 回调该扩展以告诉它再次弹出通知。有什么办法可以做到这一点吗?
I have a Chrome extension that uses AppEngine as the backend, and uses Google Account for authentication. The extension pops up notifications every 15 minutes, and stores the results in AppEngine. Whenever the notification pops up, I would like to check to make sure that the user is logged in. If they aren't logged in, then I open a page in AppEngine for them to log in.
I would then like to have a way for AppEngine to call back to the extension to tell it to pop up the notification again. Is there any way to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该考虑打开从客户端到 AppEngine 服务器的持久双向连接,而不是轮询。您可以使用Channels API 执行此类操作。
Rather than polling, you should look at opening a persistent bidirectional connection from the client to the AppEngine server. You can do this sort of thing with the Channels API.