Firefox/Projects/Firefox Start/Snippet Service: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
The about:home snippet service is a simple, highly-cached content management
The about:home snippet service is a simple, highly-cached content management
service. It is intended to assemble and deliver content snippets to the about:home
service. It is intended to assemble and deliver content snippets to the
page in Firefox.  
about:home page in Firefox.  


The content delivered is determined by details about the installation of
The content delivered is determined by details about the installation of
Line 12: Line 12:
=== About about:home ===
=== About about:home ===


about:home is a page built into Firefox 4 and above. By default, it
about:home is a page built into Firefox 4 and above. By default, it fetches
fetches content from the production snippets service once every 24 hours. If
content from the production snippets service once every 24 hours. If content is
content is available, it gets is stashed in localstorage for the page and
available, it gets is stashed in localstorage for the page and displayed from
displayed from there until the next fetch.
there until the next fetch.
 
If no content is available, the browser has a built-in default set of snippets
for display.


=== Source code for service ===
=== Source code for service ===
Line 104: Line 107:
* serve up multiple blocks of HTML, all hidden by CSS and selectively revealed by JS at random
* serve up multiple blocks of HTML, all hidden by CSS and selectively revealed by JS at random


=== Example ===
=== Example snippets content ===
 
Here's an example JSON export of a set of client match rules and associated snippets:
 
* [[File:Homesnippets 2011-02-15T23 12 38.417773.json.gz]]
 
You can take a look in a text editor, or try importing it into a private dev
instance of the service.
 
In a nutshell, this demonstrates:
 
* CSS and JS across all locales to manage content styling and visibility
* snippets served up to just en-US / en-GB locales, other locales get the default snippets shipped with the browser
* multiple HTML snippets included, hidden with CSS and one randomly revealed with JS
* images encoded as data: URIs
Confirmed users
920

edits

Navigation menu