Skip to content

Commit

Permalink
feat: minimal PWA manifest (#310)
Browse files Browse the repository at this point in the history
First stab at making it possible to install and run in app mode.
  • Loading branch information
lidel authored Jul 4, 2024
1 parent 87c50ee commit 6d758c9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
Binary file added public/icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<title><%= htmlWebpackPlugin.options.title %> | <%= htmlWebpackPlugin.options.version %></title>
<meta name="description" content="A static HTML page that initializes an instance of IPFS Service Worker Gateway" />
<meta name="robots" content="noindex" />
<link rel="manifest" href="/manifest.json">
</head>
<body>
<div id="root" class="sans-serif f5"></div>
Expand Down
18 changes: 18 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"short_name": "InBrowser IPFS",
"name": "InBrowser IPFS Gateway",
"icons": [
{
"src": "/icon-512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"id": "/?source=pwa",
"start_url": "/?source=pwa",
"background_color": "#0B3A53",
"display": "standalone",
"scope": "/",
"theme_color": "#0B3A53",
"description": "An experimental IPFS Gateway implemented as a Service Worker with @helia/verified-fetch"
}
2 changes: 1 addition & 1 deletion src/components/input-validator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function InputValidator ({ requestPath }: { requestPath: string }
return (
<div>
<ValidationMessage protocol={protocol} cidOrPeerIdOrDnslink={cidOrPeerIdOrDnslink} requestPath={requestPath}>
<a className="db" href={swPath} target="_blank">
<a className="db" href={swPath}>
<button id="load-directly" className='button-reset pv3 tc bn bg-animate bg-teal-muted hover-bg-navy-muted white pointer f4 w-100'>Load content</button>
</a>
</ValidationMessage>
Expand Down
8 changes: 8 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ const common = {
{
from: `${paths.public}/_redirects`,
noErrorOnMissing: false
},
{
from: `${paths.public}/manifest.json`,
noErrorOnMissing: false
},
{
from: `${paths.public}/icon-512.png`,
noErrorOnMissing: false
}
]
}),
Expand Down

0 comments on commit 6d758c9

Please sign in to comment.