Pageview does not work with IE11 due to JavaScript error
Closed this issue · 2 comments
Description
The pageview does not work anymore with recent Kitodo.Presentation 3.1.x in Internet Explorer 11. Unfortunately IE11 is still supported by Microsoft with Windows 10 but it lacks support for JavaScript ES6.
Reproduction
Use the IE11 and see a document in the DFG-Viewer. E.g.
Expected Behavior
A good question. We have this problem regularily. Do we support the old and buggy IE11 - or not. Unfortunately, it is still used in the IT-setup in several administrations and even in libraries.
If we don't support IE11, we should somehow notify the user.
Screenshots and Examples
Environment
- TYPO3 version: 9.5
- Kitodo.Presentation: 3.1.2
Additional Context
This issue is caused by this commit: 28f2302
Microsoft started to stop the support for IE11 in their products. See e.g. https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666
The suggestion is now to stop the support in Kitodo.Presentation as well.
A compatibilty overview of the ECMAScript 6 Features can be found here:
https://kangax.github.io/compat-table/es6/
A workaround in the last years was the usage of a transpiler like bable (https://babeljs.io/) but this makes only sense if you have a buildsystem you can include the transpiler. We are not working with a buildsystem in Kitodo.Presentation up to now.
If we suspend the support for IE11 (browser with JavaScript engine not support ES6) we should inform the visitor. This is not an easy task.
Possible solution
One approach would be the test for ECMAScript modules like described in https://stackoverflow.com/questions/29046635/javascript-es6-cross-browser-detection. This does not work inside the <head>
as described in the article because the ES6-compatible JavaScript still leads to exception in the page rendering.
For example with the following TypoScript, the JavaScript alert() is working. But the following
page {
footerData {
10 = TEXT
10.value (
<script nomodule>
var hint=document.createElement('div');
hint.innerHTML='<div class="alert" style="margin: 200px"><h2 style="padding: 20px">Hinweis: Veralteter Browser</h2><p style="color: red">Ihr Browser unterstützt kein aktuelles JavaScript (ECMAScript Version 6 - ES6). Dadurch stehen nicht alle Funktionen zur Verfügung.</p></div>';
document.getElementById("tx-dfgviewer-map").appendChild(hint);
</script>
)
}
}
We will not fix this issue as the only affected browser is MSIE 11 which is very old and even deprecated by Microsoft.
Kitodo.Presentation has distributed JavaScript files and currently no "build system" for JavaScript. So, I don't see any chance to provide the JavaScript in an older ECMAScript-version in parallel.