From 7f7ace3a8f962dfb47a0137e346c4b6f639c8cea Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Tue, 15 Jul 2014 17:09:05 -0400 Subject: Add webpage's favicon to the request body Note that this is not perfect on Chrome since the favicon is loaded asynchronously after the page loaded event. --- README.rst | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index e87ad9b..150cd4e 100644 --- a/README.rst +++ b/README.rst @@ -30,15 +30,17 @@ one the following events occur: The body of the POST request is a JSON object containing the following keys: -========= =========== -Key Name Description -========= =========== -``title`` Title of the webpage (typically the content of the ```` tag) -``url`` URL of the webpage -``time`` Time at which the event occurred. Number of milliseconds elapsed - since 1 January 1970 00:00:00 UTC -``key`` A key identifying the browser sending the request -========= =========== +=========== =========== +Key Name Description +=========== =========== +``title`` Title of the webpage (typically the content of the ``<title>`` tag) +``url`` URL of the webpage +``time`` Time at which the event occurred. Number of milliseconds elapsed + since 1 January 1970 00:00:00 UTC +``key`` A key identifying the browser sending the request +``favicon`` The URL of the webpage's favicon (or ``null`` when there is no + favicon) +=========== =========== For window deactivation events, all the keys except for the ``time`` key are set to ``null``. @@ -48,10 +50,10 @@ Example of request content: .. code:: json {"url":"https://github.com/Thibauth/browsing-activity-tracker", - "time":1405354714678, + "time":1405458411242, "title":"Thibauth/browsing-activity-tracker", - "key":"firefox"} - + "key":"firefox", + "favicon":"https://assets-cdn.github.com/favicon.ico"} Also note that the window activation and deactivation events are triggered by your window manager and vary depending on your configuration. For example, in -- cgit v1.2.3-70-g09d2