From f52b6fc6fc4fb58b849e1a23f17fa930e10531da Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 7 Dec 2013 13:27:33 +0100 Subject: [PATCH] Prevent back navigation caching in IE 11 / Fix for $.browser.msie --- com.woltlab.wcf/templates/headInclude.tpl | 6 ++++++ wcfsetup/install/files/js/WCF.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/com.woltlab.wcf/templates/headInclude.tpl b/com.woltlab.wcf/templates/headInclude.tpl index cb72ff8840..e6675d96df 100644 --- a/com.woltlab.wcf/templates/headInclude.tpl +++ b/com.woltlab.wcf/templates/headInclude.tpl @@ -175,6 +175,12 @@ {if $__sessionKeepAlive|isset} new WCF.System.KeepAlive({@$__sessionKeepAlive}); {/if} + + if ($.browser.msie) { + window.onbeforeunload = function() { + /* Prevent "Back navigation caching" (http://msdn.microsoft.com/en-us/library/ie/dn265017%28v=vs.85%29.aspx) */ + }; + } }); //]]> diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 13dbd73c3f..7059049953 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -159,6 +159,12 @@ String.prototype.hashCode = function() { // CKEditor support (disabled for Android & Windows Phone) jQuery.browser.ckeditor = (navigator.userAgent.match(/(Android|Windows Phone)/i)) ? false : true; + + // properly detect IE11 + if (jQuery.browser.mozilla && ua.match(/trident/)) { + jQuery.browser.mozilla = false; + jQuery.browser.msie = true; + } })(); /** -- 2.20.1