Swig Templating in Chrome Packaged Apps

tl;dr Check out the sample code on github I’ve been working on a Chrome Packaged App (Insomnia REST Client) for the past couple months and have leaned a lot. One of the biggest challenges about Packaged Apps is working around the Content Security Policy (CSP). The CSP makes it difficult to do common tasks such as accessing remote resources, embedding iframes, or using templating libraries. Today, I’m going to demonstrate how to use a sandboxed iframe and message passing to achieve template rendering with the Swig templating engine.

Google Analytics in Chrome Packaged Apps

tl;dr use the Chrome Platform Analytics Library. Today I released my first Chrome Packaged App. When I first set out to build a packaged app I didn’t know how restrictive it would be. For security reasons, Google disallows a lot of behavior that is usually acceptable in regular web development. One of these behaviors is the execution of external scripts, such as Google Analytics. After spending a while on Google, I figured out how to properly use Google Analytics in a Chrome Packaged App.