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

Jump to navigation Jump to search
Line 57: Line 57:
the current request URL are included in the response.
the current request URL are included in the response.


For the sake of scaling, any images or other external resources should be
All HTML content must also '''be well-formed XML'''.
encoded as [http://en.wikipedia.org/wiki/Data_URI_scheme data: URIs] so that
everything required for the snippets is delivered in the same request.  


All HTML content must also be well-formed XML.
Since multiple snippets can be included in the same response, the '''Sort order priority''' field is used to provide a sort index. So, for example, if you have
 
Since multiple snippets can be included in the same response, the '''Sort order priority'''  
field is used to provide a sort index. So, for example, if you have
some JavaScript to include after all snippets, a value of 9999 will place it
some JavaScript to include after all snippets, a value of 9999 will place it
after than the default of 0. If you have CSS to place before any other
after than the default of 0. If you have CSS to place before any other
Line 71: Line 66:
==== Considerations for external media used in snippets ====
==== Considerations for external media used in snippets ====


Any HTML, CSS, or JavaScript can be used in snippets. However, any references to external media, such as images, should be encoded as data: URIs so that the snippets can be self-contained.
Any HTML, CSS, or JavaScript can be used in snippets. However, any references to external media, such as images, should be encoded as [http://en.wikipedia.org/wiki/Data_URI_scheme data: URIs] so that the snippets can be self-contained.


For example, a tool like [http://software.hixie.ch/utilities/cgi/data/data The data: URI kitchen] can be used to convert an image file into a data: URI.
For example, a tool like [http://software.hixie.ch/utilities/cgi/data/data The data: URI kitchen] can be used to convert an image file into a data: URI.
Confirmed users
920

edits

Navigation menu