}
ngOnInit () {
+ document.getElementById('incompatible-browser').className += 'browser-ok'
+
const pathname = window.location.pathname
if (!pathname || pathname === '/') {
this.redirectService.redirectToHomepage()
shortVideoDescription: string
videoHTMLDescription = ''
likesBarTooltipText = ''
+ hasAlreadyAcceptedPrivacyConcern = false
- private hasAlreadyAcceptedPrivacyConcern = false
private otherVideos: Video[] = []
private paramsSub: Subscription
)
}
+ acceptedPrivacyConcern () {
+ localStorage.setItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true')
+ this.hasAlreadyAcceptedPrivacyConcern = true
+ }
+
private updateVideoDescription (description: string) {
this.video.description = description
this.setVideoDescriptionHTML()
// Be sure the autoPlay is set to false
return this.user.autoPlayVideo !== false
}
-
- private acceptedPrivacyConcern () {
- localStorage.setItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true')
- this.hasAlreadyAcceptedPrivacyConcern = true
- }
}
</p>
</noscript>
+ <div id="incompatible-browser" class="alert alert-danger" style="display: none">
+ <p>We are sorry but it seems that PeerTube is not compatible with your web browser.</p>
+ <p>Please try with the latest version of <a href="https://www.mozilla.org" target="_blank">Mozilla Firefox</a>.</p>
+ <p>If you think this is a mistake, do not hesitate <a href="https://github.com/Chocobozzz/PeerTube/issues/new" target="_blank">to report it</a>.</p>
+ </div>
+
+ <script type="text/javascript">
+ window.onerror = function () {
+ var elem = document.getElementById('incompatible-browser')
+ if (elem.className.indexOf('browser-ok') === -1) {
+ elem.style.display = 'block'
+ }
+ }
+ </script>
+
<my-app>
</my-app>
// .catch(err => console.error('Cannot register service worker.', err))
// }
- navigator.serviceWorker.getRegistrations().then(registrations => {
- for (const registration of registrations) {
- registration.unregister()
- }
- })
+ if (navigator.serviceWorker) {
+ navigator.serviceWorker.getRegistrations()
+ .then(registrations => {
+ for (const registration of registrations) {
+ registration.unregister()
+ }
+ })
+ }
return bootstrapModule
})
color: #000;
}
+#incompatible-browser {
+ display: none;
+ text-align: center;
+ position: absolute;
+ width: 100%;
+ top: 45%;
+}
+
strong {
font-weight: $font-semibold;
}