Skip to content
Snippets Groups Projects
Unverified Commit 47873b60 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #103 from FZJ-INM1-BDA/chore/fixInlineEvalCspViol

chore: fix safari 10 scirpt for csp violation
parents 960335db 2d32822f
No related branches found
No related tags found
No related merge requests found
......@@ -4,3 +4,7 @@
- [sane url sharing](../usage/sharing.md)
- allow `pinch rotate` motion to be used for oblique rotation on touch enabled devices
## Bugfixes
- Fixed false positive CSP violations (#490)
\ No newline at end of file
......@@ -35,44 +35,13 @@
</head>
<body>
<atlas-viewer>
<h1 class="text-center">
<h1 class="text-center" id="iav-inner">
<span class="homeAnimationDots loadingAnimationDots">&bull;</span>
<span class="homeAnimationDots loadingAnimationDots">&bull;</span>
<span class="homeAnimationDots loadingAnimationDots">&bull;</span>
</h1>
</atlas-viewer>
<script nonce="$$NONCE$$">
/**
* Catching Safari 10 bug:
*
* https://bugs.webkit.org/show_bug.cgi?id=171041
*
*/
(function(){
try{
eval('(()=>{\
let e = e => {\
console.log(e);\
for(let e of [1,2,3]){\
console.log(e);\
}\
}\
})()')
} catch (e) {
console.log(e)
const warning = 'Your browser cannot display the interactive viewer. Please use either Chrome >= 56 and/or Firefox >= 51'
console.log(warning)
const warningEl = document.createElement('h4')
warningEl.innerHTML = warning
const el = document.getElementsByTagName('atlas-viewer')
if(el.length > 0){
document.body.removeChild(el[0])
}
document.body.appendChild(warningEl)
}
})()
</script>
<script src="catchSyntaxError.js"></script>
<script src="syntaxError.js"></script>
</body>
</html>
......@@ -3,6 +3,15 @@ import '!!file-loader?context=third_party&name=vanilla.html!third_party/vanilla.
import '!!file-loader?context=third_party&name=vanilla_styles.css!third_party/styles.css'
import '!!file-loader?context=third_party&name=vanilla_nehuba.js!third_party/vanilla_nehuba.js'
/**
* Catching Safari 10 bug:
*
* https://bugs.webkit.org/show_bug.cgi?id=171041
*
*/
import '!!file-loader?context=third_party&name=catchSyntaxError.js!third_party/catchSyntaxError.js'
import '!!file-loader?context=third_party&name=syntaxError.js!third_party/syntaxError.js'
import 'zone.js'
import { enableProdMode } from '@angular/core';
......
(() => {
window.onerror = e => {
if (/^SyntaxError/.test(e)) {
console.log('Caught SyntaxError')
const warning = 'Your browser cannot display the interactive viewer. Please use either Chrome >= 56 and/or Firefox >= 51'
console.log(warning)
const warningEl = document.createElement('h4')
warningEl.innerHTML = warning
const el = document.getElementById('iav-inner')
while(el.childNodes.length > 0){
el.removeChild(el.childNodes[0])
}
el.appendChild(warningEl)
}
}
})()
(()=>{
let e = e => {
console.log(e);
for(let e of [1,2,3]){
console.log(e);
}
}
})()
\ No newline at end of file
......@@ -65,12 +65,15 @@ module.exports = merge(staticAssets, {
// TODO have to figure out how to set this properly
// needed to avoid inline eval
// shouldn't mode: 'production' do that already?
ngDevMode: false
ngDevMode: false,
ngJitMode: false
})
],
optimization: {
minimizer: [
new TerserPlugin()
new TerserPlugin({
extractComments: false
})
]
},
resolve : {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment