简体   繁体   中英

How to have Grunt launch a packaged Chrome App

I've used the [yeoman chromeapp generator][1] to scaffold out a Google Chrome Packaged App. The instructions for that generator say running the command grunt debug should launch the packaged app in the Chrome App container, but it doesn't. Instead it opens the packaged app as a regular hosted web app in a tab. Though I am a Grunt noob I'm looking at Gruntfile.js trying to figure out why it doesn't launch the app as a packaged app in the app container, but can't see where the problem is. What's the proper way to get Grunt to launch a Chrome App?

You have to go to chrome://extensions , check the box Developer Mode and then click Load Unpacked Extension and point it to your manifest file. This will load your app in a Chrome App Container.

Had the same issue with the Yeoman live-reload—not great for testing actual apps with background js, native permissions, etc.

To manually launch a Chrome app from a folder, I've been using this idiom: ~/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --load-and-launch-app=/path/to/chrome/app/"

There's also this project chrome-app-livereload ( blog post ) which supposedly swaps out livereload's standard reload with one suitable for inclusion in an app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM