# 在 IE 11 中强制使用“兼容性视图”时显示浏览器版本过旧的消息

**URL:** https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536
**Category:** Support
**Created:** [2017 年7 月 3 日 19:17 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536 "2017-07-03T19:17:21Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [2017 年7 月 3 日 19:17 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/1 "2017-07-03T19:17:21Z")

</div>

My users are getting the following in IE 11 (Discourse version v1.9.0.beta2 +218) on Windows 10:

 ![](https://global.discourse-cdn.com/meta/original/3X/9/9/993190cd312f56e87560d3b692c1e0e126c45b74.png)

I don’t see this on meta or [https://try.discourse.org/](https://try.discourse.org/) in IE 11 on the same browser, so I thought that maybe a plugin is causing the problem. When I [enter into safe mode](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504?source_topic_id=52647) and disable everything, I still get the error message.

Any additional troubleshooting suggestions to help determine what might be happening?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017 年7 月 3 日 19:27 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/2 "2017-07-03T19:27:29Z")

</div>

> [@wesochuck](#):
>
> I don’t see this on meta or [https://try.discourse.org/](https://try.discourse.org/) in IE 11 on the same browser

[Safe mode](https://meta.discourse.org/t/53504?silent=true) does not cover everything – server side effects of plugins still exist.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [2017 年7 月 3 日 19:39 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/3 "2017-07-03T19:39:53Z")

</div>

So the only way to test for server side issues with plugins is to remove them one-by-one in the yml and rebuild?

This is what we’re running:

- discourse-assign
- discourse-data-explorer
- discourse-details
- discourse-narrative-bot
- discourse-nginx-performance-report
- discourse-solved

Are there any known IE 11 issues with any of those?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017 年7 月 3 日 20:24 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/4 "2017-07-03T20:24:58Z")

</div>

No, those are all official and should not cause problems. It is very weird that you cannot reproduce this on try!

There is something different about your instance, somehow.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [2017 年7 月 3 日 20:31 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/5 "2017-07-03T20:31:57Z")

</div>

> [@codinghorror](#):
>
> There is something different about your instance, somehow.

Any suggestions about how to find that difference 😉

We’re running a docker based install on Ubuntu on a local virtual machine in case that makes any difference. We also are using SSO and require users to have an account to access the site (which is different from try and meta).

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2017 年7 月 3 日 20:37 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/6 "2017-07-03T20:37:07Z")

</div>

Can you get to a JS console on this browser and check the value of `window.ie` ?

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [2017 年7 月 3 日 20:46 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/7 "2017-07-03T20:46:28Z")

</div>

Total JS developer noob here, so please bear with me. I dropped to the IE 11 console and typed `alert(window.ie)` and got an undefined back. Not sure if that is the proper way to go about getting that information though, so glad to try something else if I’m doing it totally wrong.

I did verify earlier via [http://whatbrowser.org/](http://whatbrowser.org/) and that site believes that it is IE 11.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2017 年7 月 3 日 21:08 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/8 "2017-07-03T21:08:06Z")

</div>

The [script that shows this message](https://github.com/discourse/discourse/blob/master/vendor/assets/javascripts/browser-update.js.erb) is pretty straightforward, so I recommend following it and testing each variable to find why this message is appearing.

---

<div class="post-metadata">

### Author: ![Hector](https://avatars.discourse-cdn.com/v4/letter/h/43a26b/32.png) [@Hector](https://meta.discourse.org/u/Hector)
#### Post date: [2017 年7 月 3 日 22:44 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/9 "2017-07-03T22:44:05Z")

</div>

I think `window.ie` doesn’t exist. It was set at one point in an html conditional but was removed:

[https://github.com/discourse/discourse/commit/e1f90d12f14cd72c5624538dc1ad5732093553ad#diff-9599427925097c3c66f26ac1e0de5cadL63](https://github.com/discourse/discourse/commit/e1f90d12f14cd72c5624538dc1ad5732093553ad#diff-9599427925097c3c66f26ac1e0de5cadL63)

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2017 年7 月 3 日 22:50 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/10 "2017-07-03T22:50:01Z")

</div>

As Falco said, it’s a simple script, and `window.ie` doesn’t need to be defined, as long as `window.history.pushState` is truthy and the UA doesn’t include “Android 2.2” or “Android 2.3”, the warning bar won’t be shown.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [2017 年7 月 3 日 22:52 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/11 "2017-07-03T22:52:34Z")

</div>

Our developer is back in the office later this week, so I’ll see if he can help me step through some of this and we’ll update the thread.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2017 年7 月 3 日 23:16 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/12 "2017-07-03T23:16:33Z")

</div>

I’ve just had a fiddle with an IE11 browser I’ve got laying around, and if you hit F12, click on the “Console” tab, you get what you need. If I type:

```
window.ie

```

it prints

```
undefined

```

If I then type

```
window.history

```

it prints

```
[object History] (other gibberish)

```

If I then type

```
window.history.pushState

```

it prints

```
function pushState() { [native code] }

```

If I type

```
navigator.userAgent.indexOf("Android")

```

it prints

```
-1

```

If you get results different to these, please post a full screenshot of the results you do get. If you get the same results, but IE11 is still causing you problems, then please provide a publicly-accessible URL (the site you linked to earlier is buried behind mandatory SSO) that exhibits the problem.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [2017 年7 月 4 日 03:34 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/13 "2017-07-04T03:34:39Z")

</div>

Here is what I’m getting:

 ![](https://global.discourse-cdn.com/meta/original/3X/0/6/066fcd16bc5aa68491c360a16edd8fc3f3b988c6.png)

```
window.ie
undefined
window.history
{
   length: 1
}
window.history.pushState
undefined
navigator.userAgent.indexOf("Android")
-1

```

If I run the same process on meta, I get results similar to yours. It “feels” like a mandatory login + SSO problem. Do you know of any other similar sites you folks host that we could see if they’re having the same issue on IE 11?

> [@mpalmer](#):
>
> please provide a publicly-accessible URL

Because of the type of data we have, we’re not able to make our site publicly accessible. But in the past I’ve PM’d folks on the team with temporary credentials if that would work.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2017 年7 月 4 日 03:53 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/14 "2017-07-04T03:53:43Z")

</div>

If `window.history.pushState` is undefined, there’s your problem – if that’s false, you’ll get told your browser is too old. I’m not an expert on this part of things, but my understanding is that that is something that is provided by the browser (as part of the browser’s support for HTML5), not by Discourse, so it’s a bit mystifying that it would be undefined in an otherwise modern browser. Where things get _super_ weird is:

> [@wesochuck](#):
>
> If I run the same process on meta, I get results similar to yours.

That suggests to me that there’s something, somewhere in your site that is undefining that key. If you were running any freaky plugins, I’d definitely be giving them some epic side eye, but as you’re apparently sticking to the straight and narrow, I guess that isn’t likely. On the other hand, a binary search of the impacted plugins would only involve a max of five rebuilds, so it might be worthwhile giving it a try (I’d start with a no-plugins rebuild, just to validate that the problem is in one of them, and then go splitsies thereafter). If that doesn’t provide any diagnostically useful results, or a few rebuilds are just totally out of the question, I’m going to have to defer to someone else on the [@team](https://meta.discourse.org/groups/team) who has ninja skills in JavaScript debugging to give some guidance, whether that’s some further stuff you can try in the IE11 console, or perhaps just “temp creds please, I need to rummage around”.

---

<div class="post-metadata">

### Author: ![Hector](https://avatars.discourse-cdn.com/v4/letter/h/43a26b/32.png) [@Hector](https://meta.discourse.org/u/Hector)
#### Post date: [2017 年7 月 4 日 04:00 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/15 "2017-07-04T04:00:35Z")

</div>

Look at the warning at the top: _The attached page targets document mode 7. Some console APIs and features may not be available_.

Something is making IE run in compatibility mode. Search Stackoverflow, there are some questions that seem relevant.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2017 年7 月 4 日 04:08 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/16 "2017-07-04T04:08:49Z")

</div>

This might be relevant to Discourse:

> <https://stackoverflow.com/questions/29579063/ie11-window-history-pushstate-object-doesnt-support-property-or-method-pushst/29580526#29580526>

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2017 年7 月 4 日 04:15 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/17 "2017-07-04T04:15:03Z")

</div>

> [@Hector](#):
>
> Look at the warning at the top: The attached page targets document mode 7. Some console APIs and features may not be available.

Good catch. I brushed straight over that. Most of the stuff I can find on that error talk about fixing it by setting X-UA-Compatible (via http-equiv meta tag, usually), but as far as I can see meta doesn’t do that, either, so it presumably isn’t a panacea, nor generally necessary for Discourse.

I’ve found some posts talking about compatibility modes being set in a list; is it possible the browsers you’re all using have been configured to have your site on an IE compatibility mode list? I’m thinking this might be doable via, say, site-wide group policies or something similar. I can rule that out, at least, if you PM me some temp creds – if I can load the page OK, it’s a browser config issue.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2017 年7 月 4 日 04:20 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/18 "2017-07-04T04:20:03Z")

</div>

> [@mpalmer](#):
>
> but as far as I can see meta doesn’t do that, either

Meta isn’t on an intranet. Maybe this is the problem:

> [@wesochuck](#):
>
> We’re running a docker based install on Ubuntu on a local virtual machine in case that makes any difference.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017 年7 月 4 日 04:58 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/19 "2017-07-04T04:58:12Z")

</div>

Really great detective work that is almost certainly it; on your local network ie11 is forcing old browser compatibility mode.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2017 年7 月 4 日 11:50 UTC](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536/20 "2017-07-04T11:50:29Z")

</div>

We should just add the header back

[Next page](https://meta.discourse.org/t/browser-too-old-message-when-compatibility-mode-is-forced-in-ie-11/65536.md?page=2)
