Factor out chrome specific code in persistent.js