From f06adb5e5350e6b78a5b680a0e390e14a59513a8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 25 May 2017 06:33:59 +0900 Subject: Extract to safe.js --- src/web/app/base.pug | 3 +++ src/web/app/boot.js | 7 ------- src/web/app/safe.js | 11 +++++++++++ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 src/web/app/safe.js (limited to 'src/web') diff --git a/src/web/app/base.pug b/src/web/app/base.pug index fd57f55931..f7da0574bd 100644 --- a/src/web/app/base.pug +++ b/src/web/app/base.pug @@ -17,6 +17,9 @@ html script include ./../../../built/web/assets/boot.js + script + include ./../../../built/web/assets/safe.js + script(src='https://use.fontawesome.com/22aba0df4f.js' async) body diff --git a/src/web/app/boot.js b/src/web/app/boot.js index d38b12a742..4ac3a020ea 100644 --- a/src/web/app/boot.js +++ b/src/web/app/boot.js @@ -11,13 +11,6 @@ 'use strict'; -// Detect an old browser -if (window.fetch == undefined) { - alert( - 'お使いのブラウザが古いためMisskeyを動作させることができません。' + - 'バージョンを最新のものに更新するか、別のブラウザをお試しください。'); -} - // Get the current url information const Url = new URL(location.href); diff --git a/src/web/app/safe.js b/src/web/app/safe.js new file mode 100644 index 0000000000..1bdd10ea58 --- /dev/null +++ b/src/web/app/safe.js @@ -0,0 +1,11 @@ +/** + * 古いブラウザの検知を行う + * ブートローダーとは隔離されているため互いに影響を及ぼすことはない + */ + +// Detect an old browser +if (!'fetch' in window) { + alert( + 'お使いのブラウザが古いためMisskeyを動作させることができません。' + + 'バージョンを最新のものに更新するか、別のブラウザをお試しください。'); +} -- cgit v1.2.3-freya