Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10590 closed defect (fixed)

Internet explorer and trac problem

Reported by: gandaflux@… 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)

t10590-msie-303-replace-r11014.diff (1.6 KB ) - added by Jun Omae 12 years ago.
3rd proposal

Download all attachments as: .zip

Change History (13)

comment:1 by Remy Blank, 12 years ago

Resolution: wontfix
Status: newclosed

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".

in reply to:  1 comment:2 by Jun Omae, 12 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  
    1212    </title>
    1313    <meta py:if="chrome.content_type == 'text/html'" http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    1414    <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]-->
    1619    <py:if test="chrome.links">
    1720      <py:for each="rel, links in chrome.links.items()">
    1821        <link rel="${rel}" py:for="link in links" py:attrs="link" />
Last edited 12 years ago by Jun Omae (previous) (diff)

comment:3 by Remy Blank, 12 years ago

Resolution: wontfix
Status: closedreopened

Reported again in #10608. Reopening to try Jun's suggestion.

comment:4 by Jun Omae, 12 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

     
    1212    </title>
    1313    <meta py:if="chrome.content_type == 'text/html'" http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    1414    <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]-->
    1619    <py:if test="chrome.links">
    1720      <py:for each="rel, links in chrome.links.items()">
    1821        <link rel="${rel}" py:for="link in links" py:attrs="link" />

Thoughts?

comment:5 by Christian Boos, 12 years ago

Keywords: iexplorer added
Milestone: 0.12.4
Version: 0.12.2

Looks good! I'll test the proposed fix.

comment:6 by Christian Boos, 12 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.

by Jun Omae, 12 years ago

3rd proposal

in reply to:  6 comment:7 by Jun Omae, 12 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 Christian Boos, 12 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 Jun Omae, 12 years ago

Resolution: fixed
Status: reopenedclosed

Thanks. The patch has been committed in [11016].

comment:10 by Jun Omae, 12 years ago

Owner: set to Jun Omae

comment:11 by Remy Blank, 12 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 Christian Boos, 12 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 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?)

Version 0, edited 12 years ago by Christian Boos (next)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.