【发布时间】:2021-02-06 00:41:19
【问题描述】:
我正在尝试将我的 PHP Web 应用程序变成一个渐进式 Web 应用程序,但是当我在应用程序选项卡中打开 Chrome DevTools 时,当我将 manifest.json 放在root 但我的 ServiceWorker.js 已成功运行。
<!DOCTYPE html>
<html lang="en">
<?php
//php code
?>
<head>
<title>php</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="/manifest.json">
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
//body code
</body>
</html>
{
"name": "php",
"version": "1.0",
"short_name": "php",
"start_url": "./index.php",
"background_color": "#000000",
"display": "standalone",
"orientation": "any",
"default_locale": "en",
"description": "example",
"icons": [
{
"src": "512x512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "192x192.png",
"sizes": "192x192",
"type": "image/png"
}
]}
我在这里验证了 manifest.json 文件,它可以在测试 HTML 文件中运行;它只是试图将它放入一个 PHP 文件中,我没有看到任何事情发生。
【问题讨论】:
标签: php progressive-web-apps manifest