Phaser 2.2.1 can no longer create Google Chrome Apps

Recommended Posts

Hi -


I've just upgraded my game to Phaser 2.2.1 and my game no longer works as a Google Chrome App.


The game loads and runs OK if I just run it as a web page in Google Chrome but it cannot be installed as a Google Chrome App because it breaks the more stringent security standards for Chrome Apps.


Google Chrome Apps cannot use eval or new Function().


The latest Phaser uses new Function() and this prevents it being used as a Chrome App.


The offending code is:


// `new Function(string)` is ugly but it avoids closures and by-string property lookups.
    // Since this is a [near] micro-optimization anyway, might as well go all the way.
    /*jslint evil: true */
    // The accessor creates a new Signal (and so it should only be used from user-code.)
    Object.defineProperty(Phaser.Events.prototype, prop, {
        get: new Function("return "+backing+" || ("+backing+" = new Phaser.Signal())")
    // The dispatcher will only broadcast on an already-defined signal.
    Phaser.Events.prototype[dispatch] =

        new Function("return "+backing+" ? "+backing+".dispatch.apply("+backing+", arguments) : null"); 


I'm not sure how to raise a bug report but this should be fixed.

Share this post

Link to post
Share on other sites

As this issue is being actively addressed and should be fixed in the next release, I am marking the thread solved. Many many thanks to the developers. You do a superb job.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.