mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Introduce warning message for Safari 13 and below (#18258)
Discourse will be dropping support for these browsers in early 2023. https://meta.discourse.org/t/224747
This commit is contained in:
parent
4af080d20b
commit
3904c23121
@ -0,0 +1,30 @@
|
|||||||
|
import I18n from "I18n";
|
||||||
|
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||||
|
|
||||||
|
function setupMessage(api) {
|
||||||
|
const isSafari = navigator.vendor === "Apple Computer, Inc.";
|
||||||
|
if (!isSafari) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let safariMajorVersion = navigator.userAgent.match(/Version\/(\d+)\./)?.[1];
|
||||||
|
safariMajorVersion = safariMajorVersion
|
||||||
|
? parseInt(safariMajorVersion, 10)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
if (safariMajorVersion && safariMajorVersion <= 13) {
|
||||||
|
api.addGlobalNotice(
|
||||||
|
I18n.t("safari_13_warning"),
|
||||||
|
"browser-deprecation-warning",
|
||||||
|
{ dismissable: true, dismissDuration: moment.duration(1, "week") }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "safari-13-deprecation",
|
||||||
|
|
||||||
|
initialize() {
|
||||||
|
withPluginApi("0.8.37", setupMessage);
|
||||||
|
},
|
||||||
|
};
|
@ -3731,6 +3731,8 @@ en:
|
|||||||
|
|
||||||
browser_update: 'Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.'
|
browser_update: 'Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.'
|
||||||
|
|
||||||
|
safari_13_warning: This site will soon remove support for iOS and Safari versions 13 and below - please update your browser
|
||||||
|
|
||||||
permission_types:
|
permission_types:
|
||||||
full: "Create / Reply / See"
|
full: "Create / Reply / See"
|
||||||
create_post: "Reply / See"
|
create_post: "Reply / See"
|
||||||
|
Loading…
Reference in New Issue
Block a user