Friday, February 13, 2015

Appolymer - a simple Chrome app shell using Polymer

Appolymer is a simple Chrome App shell using Polymer



> git clone https://github.com/sandipchitale/appolymer.git
> cd appolymer
> npm install
> bower install

The following is needed to deal with CSP policy issue with Polymer in Chrome App

> grunt vulcanize

This processes the app/appolymer.html file and produces app/appolymer-csp.html and app/appolymer-csp.js. Please note that the app/js/background.js uses app/appolymer-csp.html as the URL of the created application window.

Here is the relevant portion of the Gruntfile.js:

  grunt.initConfig({
    :
    :
    vulcanize: {
   options: {
     csp: true
   },
   csp: {
    files: {
    'app/appolymer-csp.html': 'app/appolymer.html'
    },
   }
    },
    :
    :

> cd app

Install using  Settings > Extension > Select Developer Mode > Load unpacked extension... from app folder.

2 comments:

Akhash Ramamurthy said...

Hi Sandip,

Can you throw some light on how to configure the grunt and the vulcanize task on grunt?

Thanks

Sandip Chitale said...

@Akash

See the last paragraph in the blog entry.