kmp Posted December 31, 2014 Share Posted December 31, 2014 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 More sharing options...
rich Posted December 31, 2014 Share Posted December 31, 2014 Indeed: https://github.com/photonstorm/phaser/issues/1494 Link to comment Share on other sites More sharing options...
kmp Posted January 2, 2015 Author Share Posted January 2, 2015 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. Link to comment Share on other sites More sharing options...
Recommended Posts