Web App Manifest not parsed by Chrome Dev Tools

怎甘沉沦 提交于 2020-01-13 20:33:09

问题


I have a manifest.json according to the MDN spec and while it works correctly when browsing the website from a mobile device (add to homescreen popup shows up, theme color and icons load...etc) Chrome Dev Tools is unable to parse it. The same problem persists on Lighthouse (chrome extension).

Has anyone seen a similar issue? I would think that the JSON is invalid however copy-pasting into Web App Validator it is marked correct, but when inputting the URL it giving a parse error:

File isn't valid JSON: SyntaxError: Unexpected token in JSON at position 0


回答1:


It is probably a BOM character issue in the manifest.json file.

If you have Notepad++ on your machine, try open the file, click menu "Encoding" -> "Encode in UTF8 without BOM" and then save the file.

If you don't have Notepad++, search Google for "Remove BOM character" for your favorite IDE/editor.



来源:https://stackoverflow.com/questions/43277174/web-app-manifest-not-parsed-by-chrome-dev-tools

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