Fix camera scanner CSP issue

This commit is contained in:
Dennis Reimann 2021-10-21 15:02:25 +02:00 committed by Andrew Camilleri
parent d8a162fb6e
commit 926b60df3d
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
@inject BTCPayServer.Security.ContentSecurityPolicies csp
@{
csp.Add("worker-src", "blob:");
}
<template id="camera-qr-scanner-wrap">
<div v-if="modalId" :id="modalId" class="modal fade" data-bs-backdrop="static">
<div class="modal-dialog" role="document">

View file

@ -69,7 +69,7 @@
<bundle name="wwwroot/bundles/camera-bundle.min.js"></bundle>
<script>
window.coinName = "@Model.Network.DisplayName.ToLowerInvariant()";
window.addEventListener("load", async () => {
document.addEventListener("DOMContentLoaded", function () {
initCameraScanningApp("Scan wallet QR", data => {
document.getElementById("WalletFileContent").value = data;
document.getElementById("qr-import-form").submit();