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

Jump to navigation Jump to search
Line 44: Line 44:
See {{bug|592431}} for historical context on this service.
See {{bug|592431}} for historical context on this service.


=== Using a non-production service with about:home ===
=== Testing Snippets with Local or Stage Service ===


For testing against staging (ie. https://snippets.stage.mozilla.com) or a private
For testing against staging (ie. https://snippets.stage.mozilla.com) or a private
development instance of the server (ie. http://localhost:8000), you can use this add-on to switch services and force a refresh of content:
development instance of the server (ie. http://localhost:8000), you'll need to tell Firefox to use these sources instead of the regular snippet service. There are two ways to accomplish this: manually and using the snippets switcher plugin.
 
==== Manually Updating Snippet Source ====
 
# Navigate to about:config
# Search for '''browser.aboutHomeSnippets.updateUrl'''
# Change the value accordingly. For the stage server, add '''stage''' to the url so it starts https://snippets.stage.mozilla.com/.
# If you only want to retrieve a specific snippet, replace %NAME% with the appropriate value.
# Navigate to about:home.
# Open the Web Developer > Web Console (ctrl+shift+k).
# Enter localStorage['snippets-last-update'] = 0
# Refresh about:home. You should now see the new snippet.
 
==== Snippets Switcher Plugin ====
 
The snippets switcher plugin code is available here:


* https://github.com/mozilla/home-snippets-switcher
* https://github.com/mozilla/home-snippets-switcher


How this works is that there is a user preference modifiable in about:config
The xpi file is available here:
that allows you to switch the service URL
 
(<code>browser.aboutHomeSnippets.updateUrl</code>, see {{bug|603674}}).
* https://github.com/downloads/mozilla/home-snippets-switcher/home-snippets-switcher-0.4.1.xpi


However, switching the service URL doesn't get around the 24 hour wait between
The plugin works by modifying the aboutHomeSnippets.updateUrl preference and updating localstorage variables accordingly. (See {{bug|603674}} for more info).
service fetches. You can do this by hand with Firebug or other tools to modify
the localstorage variables used by the page. The add-on manages all of this.


=== Getting access to the production snippet service ===
=== Getting access to the production snippet service ===
canmove, Confirmed users, Bureaucrats and Sysops emeriti
3,698

edits

Navigation menu