mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
Improve support for old browsers (#9515)
* FEATURE: Improve crawler view * FIX: Make lazyYT crawler-friendly * DEV: Rename discourse-internet-explorer to discourse-unsupported-browser * DEV: Detect more unsupported browsers Follow-up to 4eebbd221239eaa3fc7e6f1bd6a9dcf0239b8444. * FIX: Hide browser update notice in print view
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
|
||||
function initializeInternetExplorerDeprecation(api) {
|
||||
const siteSettings = api.container.lookup("site-settings:main");
|
||||
if (siteSettings.browser_deprecation_warning) {
|
||||
const { isIE11 } = api.container.lookup("capabilities:main");
|
||||
if (isIE11) {
|
||||
api.addGlobalNotice(
|
||||
I18n.t("discourse_unsupported_browser.deprecation_warning"),
|
||||
"browser-deprecation-warning",
|
||||
{ dismissable: true, dismissDuration: moment.duration(1, "week") }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "discourse-unsupported-browser",
|
||||
|
||||
initialize() {
|
||||
withPluginApi("0.8.37", initializeInternetExplorerDeprecation);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user