#10590 closed defect (fixed)
Internet explorer and trac problem
Reported by: | Owned by: | Jun Omae | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.4 |
Component: | general | Version: | 0.12.2 |
Severity: | normal | Keywords: | iexplorer |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
There is little glitch with internet explorer from version 0.12.3+ All links on page are 'normal' for example: /changeset/596 but after click on it and loading in IE on end shows # and links looks: /changeset/596#
Now problem: User must click 2 times back button to real back to page where he been. Because from 596# click on back button move to 596 (without #) then user must click another time Back to prevoius page. Problem exists only in Internet Explorer, other browsers works fine.
Tested with IE 9.0 x64
Attachments (1)
Change History (13)
follow-up: 2 comment:1 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Replying to rblank:
This is a side-effect of [10851] that I had also noticed in #10382, but unfortunately the alternative (a reload being triggered when clicking a hash link after a redirect) is even worse.
So, unless someone finds a fix for #10382 that doesn't have this drawback, it's a "wontfix".
Changing hash when location.hash
only is not empty, the workaround works and has the drawback when only no hash. I confirmed with IE6, IE7 and IE9. However, I couldn't reproduce the original issue, #10382, with IE8 on my environment (Windows XP sp3).
-
trac/templates/layout.html
diff -r 01900289c4a1 trac/templates/layout.html
a b 12 12 </title> 13 13 <meta py:if="chrome.content_type == 'text/html'" http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 14 14 <meta py:for="meta in chrome.metas" py:attrs="meta"/> 15 <!--[if IE]><script type="text/javascript">window.location.hash = window.location.hash;</script><![endif]--> 15 <!--[if IE]><script type="text/javascript"> 16 if (window.location.hash) 17 window.location.hash = window.location.hash; 18 </script><![endif]--> 16 19 <py:if test="chrome.links"> 17 20 <py:for each="rel, links in chrome.links.items()"> 18 21 <link rel="${rel}" py:for="link in links" py:attrs="link" />
comment:3 by , 13 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Reported again in #10608. Reopening to try Jun's suggestion.
comment:4 by , 13 years ago
My suggestion on comment:2 still needs two back buttons to back when location.hash
isn't empty.
I just found the another workaround for #10382 using location.replace()
. It doesn't need two back-button to back and works fine for me on IE 6-9.
-
trac/templates/layout.html
12 12 </title> 13 13 <meta py:if="chrome.content_type == 'text/html'" http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 14 14 <meta py:for="meta in chrome.metas" py:attrs="meta"/> 15 <!--[if IE]><script type="text/javascript">window.location.hash = window.location.hash;</script><![endif]--> 15 <!--[if IE]><script type="text/javascript"> 16 if (window.location.hash) 17 window.location.replace(window.location); 18 </script><![endif]--> 16 19 <py:if test="chrome.links"> 17 20 <py:for each="rel, links in chrome.links.items()"> 18 21 <link rel="${rel}" py:for="link in links" py:attrs="link" />
Thoughts?
comment:5 by , 13 years ago
Keywords: | iexplorer added |
---|---|
Milestone: | → 0.12.4 |
Version: | → 0.12.2 |
Looks good! I'll test the proposed fix.
follow-up: 7 comment:6 by , 13 years ago
Seems to work great, with no regression on #10382. Tested with IE9 and IE7.
Note that if we had a way to detect we're currently being redirected, we could also add this condition to the check, but I didn't find a way.
comment:7 by , 13 years ago
Replying to cboos:
Note that if we had a way to detect we're currently being redirected, we could also add this condition to the check, but I didn't find a way.
Thanks for your confirmation.
The detection is possible on server side. My 3rd proposal is t10590-msie-303-replace-r11014.diff tested with IE6-9.
In Request.redirect()
, when user-agent is MSIE
and new redirecting URL has hash, append #__msie303:
to the URL (e.g. http://localhost/ticket/42#__msie303:comment:7
).
In browser side, if location.hash
has #__msie303:
, call location.replace()
with the real hash.
comment:8 by , 13 years ago
Great! I think it's a good thing to be able to see in the code the two ends of the problem, the root cause (a redirect sent to an IE browser on the server) and its workaround (the IE js trick in the client).
Tested and verified the location replacement only happens after a redirect.
comment:9 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Thanks. The patch has been committed in [11016].
comment:10 by , 13 years ago
Owner: | set to |
---|
comment:11 by , 13 years ago
It's been some time since I last looked at this, so excuse me if I'm missing something, but why is the patch from comment:4 not good enough? Is it because it forces a reload of the page on IE when a hash is present regardless of whether it's actually necessary to reload (i.e. only after a redirect)?
comment:12 by , 13 years ago
I wrongly assumed that a page reload would be triggered whenever the window.location
would be reset, but that reload apparently only happens after redirect, so the check seems indeed to be redundant unless I'm again missing something ;-)
(if we simplify this like in comment:4, can we at least the comment from r11016 and put it in layout.html
?)
This is a side-effect of [10851] that I had also noticed in #10382, but unfortunately the alternative (a reload being triggered when clicking a hash link after a redirect) is even worse.
So, unless someone finds a fix for #10382 that doesn't have this drawback, it's a "wontfix".