FEATURE: Allow users to fetch a customized manifest on PWA install

This will allow users installing a Discourse PWA to use their active
theme colors on the generated app. Thanks for @mgiuca for the tip.

Also makes the share_target config explicit to silence Chrome warnings
This commit is contained in:
Rafael dos Santos Silva 2019-03-15 17:10:05 -03:00
parent 0afa2f4c4c
commit 8ce20090f7
2 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,8 @@ class MetadataController < ApplicationController
],
share_target: {
action: "/new-topic",
method: "GET",
enctype: "application/x-www-form-urlencoded",
params: {
title: "title",
text: "body"

View File

@ -44,7 +44,7 @@
<%= render_google_tag_manager_head_code %>
<%= render_google_universal_analytics_code %>
<link rel="manifest" href="<%= Discourse.base_uri %>/manifest.webmanifest">
<link rel="manifest" href="<%= Discourse.base_uri %>/manifest.webmanifest" crossorigin="use-credentials">
<%- if SiteSetting.native_app_install_banner? %>
<meta name="apple-itunes-app" content="app-id=1173672076">