getBrowserSupportFallbackScript()
IntersectionObserver
,
MutationObserver
, customElements
and others. If any of the requirements are not met, a blocking overlay is displayed
which recommends the user to update the browser.@porsche-design-system/components-{js|angular|react|vue}
packages
which needs to be injected before the closing </body>
of your index.html
.cdn
'auto' | 'cn'
'auto'
format
For
jsx
it returns a jsx element. For sha256
it returns a SHA-256 hash of the innerHTML to use in a 'html' | 'jsx' | 'sha256'
'html'
jsx
in the format
option, it is necessary to have react/jsx-runtime
as a dependency in the project
included.<!-- index.html -->
<body>
<!--PLACEHOLDER_BROWSER_SUPPORT_FALLBACK_SCRIPT-->
</body>
<!-- package.json (tested on macOS, the script may need to be adjusted depending on the operating system used) -->
<!-- make sure to adjust the path to the index.html file -->
"scripts": {
"prestart": "yarn replace",
"replace": "placeholder='<!--PLACEHOLDER_BROWSER_SUPPORT_FALLBACK_SCRIPT-->' && partial=$placeholder$(node -e 'console.log(require(\"@porsche-design-system/components-js/partials\").getBrowserSupportFallbackScript())') && regex=$placeholder'.*' && sed -i '' -E -e \"s^$regex^$partial^\" index.html"
<!-- Alternative: Force using China CDN -->
"replace": "placeholder='<!--PLACEHOLDER_BROWSER_SUPPORT_FALLBACK_SCRIPT-->' && partial=$placeholder$(node -e 'console.log(require(\"@porsche-design-system/components-js/partials\").getBrowserSupportFallbackScript({ cdn: \"cn\" }))') && regex=$placeholder'.*' && sed -i '' -E -e \"s^$regex^$partial^\" index.html"
}
<script>
!function(){if(["IntersectionObserver","MutationObserver","customElements"].some((e=>
!(e in window)))){const e=document.createElement("script");e.src="https://cdn.ui.porsche.com/porsche-design-system/fallbacks/browser-support.1a10176.js",document.body.appendChild(e)}}();
</script>
// Alternative: Force using China CDN
<script>
!function(){if(["IntersectionObserver","MutationObserver","customElements"].some((e=>
!(e in window)))){const e=document.createElement("script");e.src="https://cdn.ui.porsche.cn/porsche-design-system/fallbacks/browser-support.1a10176.js",document.body.appendChild(e)}}();
</script>
'de' | 'ru' | 'fr' | 'en' | 'it' | 'pt' | 'es' | 'ja' | 'ko' | 'zh' | 'nl' | 'pl' | 'cs' | 'da' | 'et' | 'fi' | 'lt' | 'lv' | 'no' | 'sl' | 'sv' | 'tr' | 'uk'
lang
attribute defined in
the html
tag. Support is given for the following formats, e.g.:lang="en"
lang="en_US"
lang="en-US"
en
.lang
attribute in the html
tag is defined with the correct value before the Browser
Support Fallback script gets initialized.
A: The translation key is not part of the provided keys (see "Translations")
A: The translation key has not the correct format (see "Translations")