How to launch my swf game in my manifest.json file for my Chrome packaged web app?

浪子不回头ぞ 提交于 2019-12-04 04:51:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!