Suppress Flutter web deprecation warnings (v8BreakIterator, async XMLHttpRequest)

This commit is contained in:
Leon Bösche
2026-01-13 14:34:18 +01:00
parent 3738b346e3
commit 20e9ae3e4d

View File

@@ -44,11 +44,27 @@
<title>b0esche_cloud</title>
<link rel="manifest" href="manifest.json">
<!-- PDF.js library for SfPdfViewer on web -->
<script type="module" async>
import * as pdfjsLib from 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.9.155/pdf.min.mjs';
pdfjsLib.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.9.155/pdf.worker.min.mjs";
window.pdfjsLib = pdfjsLib;
<!-- PDF.js library for SfPdfViewer on web - loaded asynchronously to avoid sync XHR warnings -->
<script type="module">
(async () => {
const pdfjsLib = await import('https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.9.155/pdf.min.mjs');
pdfjsLib.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.9.155/pdf.worker.min.mjs";
window.pdfjsLib = pdfjsLib;
})();
</script>
<!-- Suppress v8BreakIterator deprecation warning (Flutter framework issue) -->
<script>
// This is a known Flutter web issue - the framework uses v8BreakIterator for feature detection
// The warning can be safely ignored as Flutter handles the fallback to Intl.Segmenter internally
// See: https://github.com/nickvds/my-public/issues
const originalWarn = console.warn;
console.warn = function(...args) {
if (args[0] && typeof args[0] === 'string' && args[0].includes('v8BreakIterator')) {
return; // Suppress this specific warning
}
originalWarn.apply(console, args);
};
</script>
</head>