-1

How those chrome extension listening to changes? for example a facebook chrome extension can give real time notification update to the user.

What technology behind it? The app can still able to function even the users aren't on facebook and not interacting with the site.

Elton Jamie
  • 586
  • 6
  • 17

1 Answers1

0

By querying some sort of API in the background.

Often it's just a matter of making a request to an appropriate REST endpoint (having the required credentials such as an API key/secret, for instance). Example: Twitter API docs.

For faster, real-time updates one can keep a channel open and let the server push updates over it.

This can be done with a long-lived HTTP connection just waiting until the next piece of data. Example: Twitter Streaming API for real-time updates.

WebSockets technology is a good idea for that, too. Example: Stack Overflow notifications (could not find documentation, sorry, but here's a client implementation).

See also this discussion, and this Wikipedia entry.

Community
  • 1
  • 1
Xan
  • 74,770
  • 16
  • 179
  • 206