问题
I'm struggling to get my first Flash game on the Chrome store as packaged web app.
All the tutorials I manage to find online are old and obsolete, or missing crucial info for a noob like me.
This is what I have so far for my manifest.json file:
{
"name": "Snappy Turtle",
"description": "Swim dangerous waters.",
"version": "1.8",
"manifest_version": 2,
"app": {
"background": {
"scripts": ["background.js"]
}
},
"icons": { "16": "favicon.png", "128": "icon.png" }
}
Somewhere in the mix I need something like the following so it will actually launch my game:
"launch": {
"local_path": "index.html"
}
},
but any way I try to add it I get errors, and of course, if I leave it out, no error report, but then the game wont run. ;)
Can any of you kind people who actually know what they're doing please point out to me the proper way to add this crucial bit in a way that chrome will actually accept?
回答1:
You can't do it with a (new) Chrome App.
From Disabled Web Features:
Disabled: Flash
Workaround: Use HTML5 Platform.
You might get it working by embedding an external page in a <webview>
, but I doubt it will work - my guess is that the ban extends to webview content.
FYI, all flash game "apps" in the Chrome Web Store are not Chrome Apps, but hosted apps (also called installable web apps). Note that the documentation for them is currently broken, there are still traces at this tutorial.
回答2:
You can run it by doing this code:
<object>
<embed src="file.swf" width="100%" height="100%"></embed>
</object>
来源:https://stackoverflow.com/questions/29068541/how-to-launch-my-swf-game-in-my-manifest-json-file-for-my-chrome-packaged-web-ap