Jump to content

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.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...