Show Warning is browser safari/brave is incompatible with vault on all pages

This commit is contained in:
nicolas.dorier 2023-12-07 14:00:15 +09:00
parent 379286c366
commit eda437995f
No known key found for this signature in database
GPG key ID: 6618763EF09186FE
6 changed files with 29 additions and 40 deletions

View file

@ -138,6 +138,7 @@
<ItemGroup>
<Watch Include="Views\**\*.*"></Watch>
<Watch Remove="Views\Shared\LocalhostBrowserSupport.cshtml" />
<Watch Remove="Views\UIAccount\CheatPermissions.cshtml" />
<Watch Remove="Views\UIReports\StoreReports.cshtml" />
<Content Update="Views\UIApps\_ViewImports.cshtml">

View file

@ -0,0 +1,22 @@
<div id="walletAlert" class="alert alert-warning alert-dismissible my-4" style="display:none;" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
<vc:icon symbol="close" />
</button>
<span id="alertMessage"></span>
</div>
<script>
var alertMsg = document.getElementById("alertMessage");
var walletAlert = document.getElementById("walletAlert");
var isSafari = window.safari !== undefined;
if (isSafari)
{
alertMsg.innerHTML = "Safari doesn't support BTCPay Server Vault. Please use a different browser. (<a class=\"alert-link\" href=\"https://bugs.webkit.org/show_bug.cgi?id=171934\" target=\"_blank\" rel=\"noreferrer noopener\">More information</a>)";
walletAlert.style.display = null;
}
var isBrave = navigator.brave !== undefined;
if (isBrave)
{
alertMsg.innerHTML = "Brave supports BTCPay Server Vault, but you need to disable Brave Shields. (<a class=\"alert-link\" href=\"https://www.updateland.com/how-to-turn-off-brave-shields/\" target=\"_blank\" rel=\"noreferrer noopener\">More information</a>)";
walletAlert.style.display = null;
}
</script>

View file

@ -15,12 +15,7 @@
<p class="lead text-secondary mt-3">Using BTCPay Server Vault (NFC)</p>
</header>
<div id="walletAlert" class="alert alert-warning alert-dismissible my-4" style="display:none;" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
<vc:icon symbol="close" />
</button>
<span id="alertMessage"></span>
</div>
<partial name="LocalhostBrowserSupport" />
<div id="body" class="my-4">
<form id="broadcastForm" method="post" style="display:none;">
@ -65,19 +60,5 @@
document.addEventListener("DOMContentLoaded", function () {
askSign();
});
var alertMsg = document.getElementById("alertMessage");
var walletAlert = document.getElementById("walletAlert");
var isSafari = window.safari !== undefined;
if (isSafari)
{
alertMsg.innerHTML = "Safari doesn't support BTCPay Server Vault. Please use a different browser. (<a class=\"alert-link\" href=\"https://bugs.webkit.org/show_bug.cgi?id=171934\" target=\"_blank\" rel=\"noreferrer noopener\">More information</a>)";
walletAlert.style.display = null;
}
var isBrave = navigator.brave !== undefined;
if (isBrave)
{
alertMsg.innerHTML = "Brave supports BTCPay Server Vault, but you need to disable Brave Shields. (<a class=\"alert-link\" href=\"https://www.updateland.com/how-to-turn-off-brave-shields/\" target=\"_blank\" rel=\"noreferrer noopener\">More information</a>)";
walletAlert.style.display = null;
}
</script>
}

View file

@ -20,6 +20,8 @@
<div asp-validation-summary="All" class="text-danger"></div>
}
<partial name="LocalhostBrowserSupport" />
<template id="modal-template">
<div class="modal-dialog" role="document">
<form class="modal-content" method="post" enctype="multipart/form-data">

View file

@ -20,6 +20,8 @@
<div asp-validation-summary="All" class="text-danger"></div>
}
<partial name="LocalhostBrowserSupport" />
<div class="row mt-5 mb-4">
<div class="col-md-8 mx-auto">
<div id="vault-status" class="mb-4"></div>

View file

@ -25,12 +25,7 @@
<p class="lead text-secondary mt-3">Using BTCPay Server Vault</p>
</header>
<div id="walletAlert" class="alert alert-warning alert-dismissible my-4" style="display:none;" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
<vc:icon symbol="close" />
</button>
<span id="alertMessage"></span>
</div>
<partial name="LocalhostBrowserSupport" />
<div id="body" class="my-4">
<form id="broadcastForm" asp-action="WalletSendVault" asp-route-walletId="@walletId" method="post" style="display:none;">
@ -77,19 +72,5 @@
document.addEventListener("DOMContentLoaded", function () {
askSign();
});
var alertMsg = document.getElementById("alertMessage");
var walletAlert = document.getElementById("walletAlert");
var isSafari = window.safari !== undefined;
if (isSafari)
{
alertMsg.innerHTML = "Safari doesn't support BTCPay Server Vault. Please use a different browser. (<a class=\"alert-link\" href=\"https://bugs.webkit.org/show_bug.cgi?id=171934\" target=\"_blank\" rel=\"noreferrer noopener\">More information</a>)";
walletAlert.style.display = null;
}
var isBrave = navigator.brave !== undefined;
if (isBrave)
{
alertMsg.innerHTML = "Brave supports BTCPay Server Vault, but you need to disable Brave Shields. (<a class=\"alert-link\" href=\"https://www.updateland.com/how-to-turn-off-brave-shields/\" target=\"_blank\" rel=\"noreferrer noopener\">More information</a>)";
walletAlert.style.display = null;
}
</script>
}