我正在开发一个流星应用程序,我希望它也可以作为一个渐进的Web应用程序。我没有在关于链接manifest.json文件的流星或渐进式Web应用程序文档中找到任何内容。
我最初尝试将我的manifest.json文件链接到文件夹根目录中,然后在客户端文件夹的main.html中指向它(即:../ manifest.json),但是这不起作用然后我尝试移动清单。客户端文件夹中的json并将其链接为./manifest.json,但这也无效。在检查开发工具时>申请>显示它显示以下屏幕: 按“添加到主屏幕”后,我收到以下错误:
Site cannot be installed: the manifest could not be fetched, is empty, or could not be parsed
另外,当我转到localhost:3000 / manifest.json时,它给了我以下内容(看起来像依赖项列表
{"format":"web-program-pre1","manifest":[{"path":"packages/underscore.js","where":"client","type":"js","cacheable":true,"url":"/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c","size":150249,"hash":"cde485f60699ff9aced3305f70189e39c665183c"},{"path":"packages/meteor.js","where":"client","type":"js","cacheable":true,"url":"/packages/meteor.js?hash=27829e936d09beae3149ecfbf3332c42ccb1596f","size":121106,"hash":"27829e936d09beae3149ecfbf3332c42ccb1596f"},{"path":"packages/meteor-base.js","where":"client","type":"js","cacheable":true,"url":"/packages/meteor-base.js?hash=a4d07a6b394e56bbe6ccc773c95e7cdb3434960d","size":720,"hash":"a4d07a6b394e56bbe6ccc773c95e7cdb3434960d"},{"path":"packages/mobile-experience.js","where":"client","type":"js","cacheable":true,"url":"/packages/mobile-experience.js?hash=8ded3e69a3e367f321ab9a2b52e3ecdd2661a365","size":726,"hash":"8ded3e69a3e367f321ab9a2b52e3ecdd2661a365"},{"path":"packages/modules-runtime.js","where":"client","type":"js","cacheable":true,"url":"/packages/modules-runtime.js?hash=2b888cb7873bacf38cf32f41d44ac3d4fd600b06","size":42886,"hash":"2b888cb7873bacf38cf32f41d44ac3d4fd600b06"},{"path":"packages/modules.js","where":"client","type":"js","cacheable":true,"url":"/packages/modules.js?hash=33df952a92dbc669360ee4d44c315250c4cc9438","size":3580788,"hash":"33df952a92dbc669360ee4d44c315250c4cc9438"},{"path":"packages/es5-shim.js","where":"client","type":"js","cacheable":true,"url":"/packages/es5-shim.js?hash=adc3c6270d5697523fe2a72e73428390b7eba83a","size":346492,"hash":"adc3c6270d5697523fe2a72e73428390b7eba83a"},{"path":"packages/promise.js","where":"client","type":"js","cacheable":true,"url":"/packages/promise.js?hash=c7ad465683112ebc31f372d2545b70d85b822c0d","size":65779,"hash":"c7ad465683112ebc31f372d2545b70d85b822c0d"},{"path":"packages/ecmascript-runtime.js","where":"client","type":"js","cacheable":true,"url":"/packages/ecmascript-runtime.js?hash=04c184f5bc9ce59705dac3ac894ecb3ca60eb387","size":519496,"hash":"04c184f5bc9ce59705dac3ac894ecb3ca60eb387"},{"path":"packages/babel-compiler.js","where":"client","type":"js","cacheable":true,"url":"/packages/babel-compiler.js?hash=a9546d4e245cfe40b406e08d40bf106241f01683","size":723,"hash":"a9546d4e245cfe40b406e08d40bf106241f01683"},{"path":"packages/ecmascript.js","where":"client","type":"js","cacheable":true,"url":"/packages/ecmascript.js?hash=370a8752194bcf73be7fffa3635715d0fbf7853d","size":716,"hash":"370a8752194bcf73be7fffa3635715d0fbf7853d"},{"path":"packages/base64.js","where":"client","type":"js","cacheable":true,"url":"/packages/base64.js?hash=0053489bb30bb5c0e3545df151f83e41150344b0","size":15332,"hash":"0053489bb30bb5c0e3545df151f83e41150344b0"},{"path":"packages/ejson.js","where":"client","type":"js","cacheable":true,"url":"/packages/ejson.js?hash=0f17ced99d522d48cd8f8b2139167fd06babd969","size":81952,"hash":"0f17ced99d522d48cd8f8b2139167fd06babd969"},{"path":"packages/id-map.js","where":"client","type":"js","cacheable":true,"url":"/packages/id-map.js?hash=c7aea8dfa2bf46ff2ae0aa6c6cf09e36abc61d07","size":8189,"hash":"c7aea8dfa2bf46ff2ae0aa6c6cf09e36abc61d07"},{"path":"packages/ordered-dict.js","where":"client","type":"js","cacheable":true,"url":"/packages/ordered-dict.js?hash=bacdd1852075630a01f7de783e5e8e8aa8541cdc","size":20041,"hash":"bacdd1852075630a01f7de783e5e8e8aa8541cdc"},{"path":"packages/tracker.js","where":"client","type":"js","cacheable":true,"url":"/packages/tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b","size":86619,"hash":"997515fa2d5b0530ba07741da556c4b36963ef3b"},{"path":"packages/babel-runtime.js","where":"client","type":"js","cacheable":true,"url":"/packages/babel-runtime.js?hash=165aebf5a2dbf1fe13aae78554227471ae06f96a","size":11132,"hash":"165aebf5a2dbf1fe13aae78554227471ae06f96a"},{"path":"packages/random.js","where":"client","type":"js","cacheable":true,"url":"/packages/random.js?hash=a3be1ee923a6fc933f063c7f8de3e15243e12f47","sourceMap":"packages/random.js.map","sourceMapUrl":"/packages/a3be1ee923a6fc933f063c7f8de3e15243e12f47.map","size":39765,"hash":"a3be1ee923a6fc933f063c7f8de3e15243e12f47"},{"path":"packages/mongo-id.js","where":"client","type":"js","cacheable":true,"url":"/packages/mongo-id.js?hash=345d169d517353f8146292b4abd24061721f8b26","size":12235,"hash":"345d169d517353f8146292b4abd24061721f8b26"},{"path":"packages/diff-sequence.js","where":"client","type":"js","cacheable":true,"url":"/packages/diff-sequence.js?hash=15014d7b1e11c05111a386992e684ab1d3cc4158","size":24291,"hash":"15014d7b1e11c05111a386992e684ab1d3cc4158"},{"path":"packages/geojson-utils.js","where":"client","type":"js","cacheable":true,"url":"/packages/geojson-utils.js?hash=b204c7d4caf119e6883522fb87c6cce060724bf0","size":46635,"hash":"b204c7d4caf119e6883522fb87c6cce060724bf0"},{"path":"packages/minimongo.js","where":"client","type":"js","cacheable":true,"url":"/packages/minimongo.js?hash=5f645b1615e1812c2bfd57e137c77c24162c7884","sourceMap":"packages/minimongo.js.map","sourceMapUrl":"/packages/5f645b1615e1812c2bfd57e137c77c24162c7884.map","size":488122,"hash":"5f645b1615e1812c2bfd57e137c77c24162c7884"},{"path":"packages/check.js","where":"client","type":"js","cacheable":true,"url":"/packages/check.js?hash=87c633843915b879a0c9676ea81f1cd351296e41","size":67991,"hash":"87c633843915b879a0c9676ea81f1cd351296e41"},{"path":"packages/retry.js","where":"client","type":"js","cacheable":true,"url":"/packages/retry.js?hash=1e409617b538ff3e2b0238b15e45b3380c51a224","size":6891,"hash":"1e409617b538ff3e2b0238b15e45b3380c51a224"},{"path":"packages/ddp-common.js","where":"client","type":"js","cacheable":true,"url":"/packages/ddp-common.js?hash=d42359bcace6c66ac90e2782193494253ee68155","size":45313,"hash":"d42359bcace6c66ac90e2782193494253ee68155"},{"path":"packages/reload.js","where":"client","type":"js","cacheable":true,"url":"/packages/reload.js?hash=628b069673bffbc7390ba84ece8809c8c88c2eed","size":26433,"hash":"628b069673bffbc7390ba84ece8809c8c88c2eed"},{"path":"packages/ddp-client.js","where":"client","type":"js","cacheable":true,"url":"/packages/ddp-client.js?hash=d69811b75e636077a323c16b077a38a29bacca9e","sourceMap":"packages/ddp-client.js.map","sourceMapUrl":"/packages/d69811b75e636077a323c16b077a38a29bacca9e.map","size":637472,"hash":"d69811b75e636077a323c16b077a38a29bacca9e"},{"path":"packages/ddp.js","where":"client","type":"js","cacheable":true,"url":"/packages/ddp.js?hash=25dc3f428447c81620c91c4245dbc6e4f7d32fb7","size":874,"hash":"25dc3f428447c81620c91c4245dbc6e4f7d32fb7"},{"path":"packages/ddp-server.js","where":"client","type":"js","cacheable":true,"url":"/packages/ddp-server.js?hash=1beefbc7bd033ea687e7ab8fbd5694df072662af","size":719,"hash":"1beefbc7bd033ea687e7ab8fbd5694df072662af"},{"path":"packages/allow-deny.js","where":"client","type":"js","cacheable":true,"url":"/packages/allow-deny.js?hash=0a3547d203dfd89d9484cad533c54cd0f4778263","sourceMap":"packages/allow-deny.js.map","sourceMapUrl":"/packages/0a3547d203dfd89d9484cad533c54cd0f4778263.map","size":62341,"hash":"0a3547d203dfd89d9484cad533c54cd0f4778263"},{"path":"packages/insecure.js","where":"client","type":"js","cacheable":true,"url":"/packages/insecure.js?hash=a0e5f17c280f4c7b05178d36a7ceb07cb7b086c6","size":714,"hash":"a0e5f17c280f4c7b05178d36a7ceb07cb7b086c6"},{"path":"packages/mongo.js","where":"client","type":"js","cacheable":true,"url":"/packages/mongo.js?hash=83e088259340bb5e2ce8c879da15b15b9592f8ee","sourceMap":"packages/mongo.js.map","sourceMapUrl":"/packages/83e088259340bb5e2ce8c879da15b15b9592f8ee.map","size":99184,"hash":"83e088259340bb5e2ce8c879da15b15b9592f8ee"},{"path":"packages/blaze-html-templates.js","where":"client","type":"js","cacheable":true,"url":"/packages/blaze-html-templates.js?hash=6e8335ce66460e45f00da73c7497654c5e26e236","size":729,"hash":"6e8335ce66460e45f00da73c7497654c5e26e236"},{"path":"packages/reactive-var.js","where":"client","type":"js","cacheable":true,"url":"/packages/reactive-var.js?hash=ec712fa3ae588c4a1e7017f0bb4507c725391225","size":13609,"hash":"ec712fa3ae588c4a1e7017f0bb4507c725391225"},{"path":"packages/standard-minifier-css.js","where":"client","type":"js","cacheable":true,"url":"/packages/standard-minifier-css.js?hash=cfe82682f4394d3ffc6335555c1f9f3f73294507","size":730,"hash":"cfe82682f4394d3ffc6335555c1f9f3f73294507"},{"path":"packages/standard-minifier-js.js","where":"client","type":"js","cacheable":true,"url":"/packages/standard-minifier-js.js?hash=041bab58c8a89172eaab795deb5d96e38b64ec37","size":729,"hash":"041bab58c8a89172eaab795deb5d96e38b64ec37"},{"path":"packages/shell-server.js","where":"client","type":"js","cacheable":true,"url":"/packages/shell-server.js?hash=6ff1313e4bf7618e577eb2604a580b2ea9b7631f","size":721,"hash":"6ff1313e4bf7618e577eb2604a580b2ea9b7631f"},{"path":"packages/autopublish.js","where":"client","type":"js","cacheable":true,"url":"/packages/autopublish.js?hash=073bd4c42d2fb6182c944501b4f30e8d17bcceb3","size":717,"hash":"073bd4c42d2fb6182c944501b4f30e8d17bcceb3"},{"path":"packages/webapp.js","where":"client","type":"js","cacheable":true,"url":"/packages/webapp.js?hash=8024f6bce97bd768bcff7fc9d76449e74f051e36","sourceMap":"packages/webapp.js.map","sourceMapUrl":"/packages/8024f6bce97bd768bcff7fc9d76449e74f051e36.map","size":3001,"hash":"8024f6bce97bd768bcff7fc9d76449e74f051e36"},{"path":"packages/livedata.js","where":"client","type":"js","cacheable":true,"url":"/packages/livedata.js?hash=7cf1831a60b48e304b054aee1ae0f7e38ff35d09","size":958,"hash":"7cf1831a60b48e304b054aee1ae0f7e38ff35d09"},{"path":"packages/hot-code-push.js","where":"client","type":"js","cacheable":true,"url":"/packages/hot-code-push.js?hash=2e864a0bdd0d5f686115099f8c48eb6c866b5b14","size":722,"hash":"2e864a0bdd0d5f686115099f8c48eb6c866b5b14"},{"path":"packages/jquery.js","where":"client","type":"js","cacheable":true,"url":"/packages/jquery.js?hash=c57b3cfa0ca9c66400d4456b6f6f1e486ee10aad","size":1297965,"hash":"c57b3cfa0ca9c66400d4456b6f6f1e486ee10aad"},{"path":"packages/observe-sequence.js","where":"client","type":"js","cacheable":true,"url":"/packages/observe-sequence.js?hash=8fe58036c6ba00c458f54c360a21fd0e41fb7ee0","size":33341,"hash":"8fe58036c6ba00c458f54c360a21fd0e41fb7ee0"},{"path":"packages/deps.js","where":"client","type":"js","cacheable":true,"url":"/packages/deps.js?hash=7313f5a2685c6c2c673c78c15c8ce86ff59ab0c9","size":932,"hash":"7313f5a2685c6c2c673c78c15c8ce86ff59ab0c9"},{"path":"packages/htmljs.js","where":"client","type":"js","cacheable":true,"url":"/packages/htmljs.js?hash=1ac878018eee6c53ed1375dc7ee75fc6865666ae","size":60540,"hash":"1ac878018eee6c53ed1375dc7ee75fc6865666ae"},{"path":"packages/blaze.js","where":"client","type":"js","cacheable":true,"url":"/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761","size":472754,"hash":"f33d3dfed63a491d24e3aa07ad66c24b5fe8c761"},{"path":"packages/spacebars.js","where":"client","type":"js","cacheable":true,"url":"/packages/spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a","size":26814,"hash":"ebf9381e7fc625d41acb0df14995b7614360858a"},{"path":"packages/templating-compiler.js","where":"client","type":"js","cacheable":true,"url":"/packages/templating-compiler.js?hash=a71883cdec50e95ca135291415990753ed6d57fc","size":728,"hash":"a71883cdec50e95ca135291415990753ed6d57fc"},{"path":"packages/templating-runtime.js","where":"client","type":"js","cacheable":true,"url":"/packages/templating-runtime.js?hash=c18de19afda6e9f0db7faf3d4382a4c953cabe18","size":24132,"hash":"c18de19afda6e9f0db7faf3d4382a4c953cabe18"},{"path":"packages/templating.js","where":"client","type":"js","cacheable":true,"url":"/packages/templating.js?hash=c2cf38de06efb47f67affb2dff9320e5eef33893","size":909,"hash":"c2cf38de06efb47f67affb2dff9320e5eef33893"},{"path":"packages/launch-screen.js","where":"client","type":"js","cacheable":true,"url":"/packages/launch-screen.js?hash=2f56943306c7e900ed9f4d894b87f534ebffeaeb","size":8391,"hash":"2f56943306c7e900ed9f4d894b87f534ebffeaeb"},{"path":"packages/ui.js","where":"client","type":"js","cacheable":true,"url":"/packages/ui.js?hash=039c55a98376abd03d9d8cd4100895861b897643","size":979,"hash":"039c55a98376abd03d9d8cd4100895861b897643"},{"path":"packages/autoupdate.js","where":"client","type":"js","cacheable":true,"url":"/packages/autoupdate.js?hash=1fd9cf3472adaa6887170d88ab5ea1ddabf695fa","size":17200,"hash":"1fd9cf3472adaa6887170d88ab5ea1ddabf695fa"},{"path":"packages/global-imports.js","where":"client","type":"js","cacheable":true,"url":"/packages/global-imports.js?hash=ab884bfb9c930842d4ada35f58a36f5c48629abe","size":1047,"hash":"ab884bfb9c930842d4ada35f58a36f5c48629abe"},{"path":"app/app.js","where":"client","type":"js","cacheable":true,"url":"/app/app.js?hash=9965fafa8dfa48f31fe2eae4ac85a6116d596ca3","sourceMap":"app/app.js.map","sourceMapUrl":"/app/9965fafa8dfa48f31fe2eae4ac85a6116d596ca3.map","size":20675,"hash":"9965fafa8dfa48f31fe2eae4ac85a6116d596ca3"},{"path":"merged-stylesheets.css","where":"client","type":"css","cacheable":true,"url":"/merged-stylesheets.css?hash=1a165863f95fc2ba4d6af1034a1380b15db31f19","sourceMap":"merged-stylesheets.css.map","sourceMapUrl":"/1a165863f95fc2ba4d6af1034a1380b15db31f19.map","size":30,"hash":"1a165863f95fc2ba4d6af1034a1380b15db31f19"},{"path":"head.html","where":"internal","type":"head","hash":"9a17c869454948d630b8d20c4b9837b2e1f402a1"}],"version":"cfd2bd53671a5ca4ca4da9eca9eadb7f4d4a4ee6","PUBLIC_SETTINGS":{}}
这与program.json文件(/.meteor/local/build/programs/web.browser/program.json)中的数据相同,所以我尝试将一个对象(下面的对象)添加到清单数组中使用我的manifest.json数据,它不会让我保存文件(无法保存/.meteor/local/build/programs/web.browser/program.json)。
{
"name": "<My app>",
"short_name": "my app",
"start_url": "/",
"display": "standalone",
"background_color": "#3E4EB8",
"theme_color": "#2F3BA2"
}
有谁知道如何添加我的清单信息以让我的应用程序以我想要的方式工作?
答案 0 :(得分:5)
流星为自己预留了/manifest.json,所以你不能使用它。
解决方案是使用清单文件的另一个URL。试试这个:
在您定义&lt; head&gt;的html中,添加以下行:
<head>
[...]
<link rel="manifest" href="/site_manifest.json">
[...]
</head>
将您的清单文件(&#39; site_manifest.json&#39;)放在/ public文件夹中。它现在应该工作。