Handle empty manifest values
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Fall back to HTML if possible, discard otherwise
This commit is contained in:
2024-02-01 16:45:58 +02:00
parent 8d79113438
commit 999bc49e2d
4 changed files with 636 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ module Manifique
[ :name, :short_name, :description, :icons,
:theme_color, :background_color, :display,
:start_url, :scope, :share_target ].map(&:to_s).each do |prop|
next unless manifest[prop]
next unless manifest[prop] && !manifest[prop].to_s.empty?
self.send("#{prop}=", manifest[prop])
self.from_web_manifest.add(prop)
end