internet explorer - Why does IE8 running on XP and Win7 Virtual Machine deletes the history while browsing the same site with javascript routing?

07
2014-07
  • Yoda

    I am using sammy.js with my asp.net mvc web application for client-side routing so as to provide single page user experience. I have created a demo application which works fine in IE9+ and other modern browsers. However, while running in IE8 on XP and Win7, I'm facing a strange problem. While browsing this demos site, IE8 remembers the back and forward navigation for initial browsing and then it totally forgets about the browsing history or steps I have taken to reach the current page. So, the back button gets disabled as there is no browsing history linked. This is not happening in other browsers and they remember the pages I'm browsing.

    This is the link of the script that I have written where I have defined my sammy.js routes.

    The structure of my app is like this - A User:

    • comes to http://www.abc.com/
    • is shown a login page as per #/ route
    • if authenticated, home page is shown which is a result of ajax post action.
    • home-page have many options to go to details page which is the result of ajax post action.

    Now, IE8 remembers only some of these steps but keeps deleting the history items in the browsing session on its own. I have tried using the script debugger of IE and no error was showed.

    On every route, I have also tried using alert(history.length); which gives different random number not I was expecting like +1 every-time I visit a new page. Then I found this support information on Microsoft's website. Disabling the automatic crash recovery feature didn't helped in this case.

    I'm not able to figure out the reason behind this strange problem. The codes works fine for other browsers. I have also tried resetting IE8 on XP and Win7.

    It would be really helpful if anyone can tell me what am I missing or doing wrong.

    Cheers

  • Answers
  • Yoda

    I have really tried many things to identify any possible reason of the issue above. Even rewrote all my javascript navigation code and checked server-side code.

    But the only place where I got the solution is at site: enhanceie which states that there is a bug in IE8 which reads like:

    IE0012: IE Travellog broken when navigating back/away from a page with a large POST form If there is a form input field with a value longer than 523,659 characters, when you navigate away from the page, IE may clear the current session's travellog (similar to history), disabling the back and forward buttons. Repros in IE6 & IE7.

    There are following solutions that you can go for:

    • Check for the input field that has lots of characters as mentioned above and solve your problem.
    • If you have control over the system where IE8 will be used, you can add the following registry key on that machine. There is no existing key, so, you need to add a new one:

      [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TravelLog] "MaxSize"=dword:ffffffff

    I am really relaxed to find this information as I spent really long time to solve this issue. Hope this will help someone.


  • Related Question

    windows xp - IE8 Refuses to run Javascript from Local Hard Drive
  • Josh Stodola

    I have a problem that just started at work recently and the network manager is certain he did not change anything with the group policy. Anyways, here is a detailed description of the problem.

    My machine is Windows XP SP3, and I use IE8 to browse. We have McAffee anti-virus software that I am unable to configure. I use the following file to test...

    <!DOCTYPE html>
    <html>
      <head>
        <title>Javascript Test</title>
      </head>
      <body>
        <script type="text/javascript">
          document.write("<h1>PASS</h1>");
        </script>
        <noscript>
          <h1>FAIL</h1>
        </noscript>
      </body>
    </html>
    

    When I open this file from the C: drive, it fails every time. If I execute it anywhere else (local/remote web server or on a mapped network drive), it works just fine. When I am simply browsing the Internet, Javascript on web sites works just fine. It is only failing on files running from my C: drive. Additionally, I have had a couple other programmers in the department try this file on their C: drive, and it works fine for them. So I don't believe it is a group policy thing.

    I need to fix this because I do extensive testing from my C: drive, and I am accustomed to doing so. I don't want to get into the habit of moving files to a different drive just to test.

    Things I have tried:

    • Enabled "Allow Active Content to Run Files on My Computer" in Options | Advanced | Security
    • Enabled "Allow Active Scripting" in Options | Security | Custom Level
    • Verified that "Script" was not checked as disabled in Developer Toolbar
    • Added localhost to Trusted Sites in Options
    • Disabled McAffee completely (momentarily, with help from network admin)
    • Used an older DOCTYPE in my test HTML page
    • Re-installed IE8 completely
    • Ran regsvr32 on the JScript.dll
    • Slammed keyboard

    I am sure that there is a setting somewhere that will fix this problem, possibly in the registry. I would not be surprised if it was related to the developer toolbar. At this point I do not know where else to look.

    Can anyone help me resolve this problem?

    EDIT: Regardless of the bounty, this issue is still ongoing.


  • Related Answers
  • Community

    Open registry key

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\n

    Where n is the zone index, where 0 means My Computer. This zone is not available in Internet Options. Set Value 1400 to 0 to enable Javascript.

  • user2428118

    Have you tried to add a "Mark of the Web" in your HTML source?

    Just add something like:

    <!DOCTYPE html>
    <!-- saved from url=(0021)http://www.google.com -->
    <html>
    

    A Mark of the Web is after the DOCTYPE tag, alone on a separate line, just before <html>.

    See the MSDN documentation on Mark of the Web for full help.

  • kentaromiura

    if the computer is subject to corporate security policies, you may consider setting up a virtual machine (e.g. with Virtual Box or MS Virtual PC) to test your java scripts.

    Microsoft offers a variety of pre-activated virtual hard drives (they work with VirtualBox and VPC) with either Vista or XP and IE6, 7 and 8. Internet Explorer Application Compatibility VPC Images are free and the current set is valid until April 1, 2010.

  • Goyuix

    Here are two thoughts that may help:

    Rename it to test.hta - this will launch it as an HTML Application instead of just plain HTML. You may need to add <HTA:APPLICATION> with a few attributes to inside the HEAD element - but it should work like a champ. You can read more about HTA's here: http://msdn.microsoft.com/en-us/library/ms536496.aspx

    Can you use a local web server to perhaps get around the file system issues? If you were to install Visual Web Developer Express it comes with a web server you can use for testing, or you could always install IIS (if it is WinXP Pro), Apache, etc.

  • jburke

    Trying editing the settings for DCOM

    Go to Run and type dcomcnfg, under component services right click on my computer and go properties. Then go to Default properties and Enable COM internet Services on this computer. also check and make sure Default Authentication Level is set to connect and Impersonation level is set to Identify.

  • harrymc

    If you go to Internet Options / Security Tab / Internet / Custom button, then scroll down to the Miscellaneous section, you will find several entries that control the JavaScript engine in IE8.

    You might compare them on your computer with these on a computer on which this works.

    If with this you don't find the problem, you can also do the same with
    gpedit.msc / Local computer policy / Computer Configuration / Administrative Templates / Windows Components / Internet Explorer.
    You can here right-click on "Internet Explorer" and Export all the settings to a text file, which will help in comparing them between the two computers.

  • davidcl

    I suspect this won't help, but have you checked the registry key for allowing local scripts to run?

    HKCU \ Software \ Microsoft \ Internet Explorer \ Main \ FeatureControl \ FEATURE_LOCALMACHINE_LOCKDOWN

    In the right-pane, create a new REG_DWORD named iexplore.exe and set it to 0

    Values:

    0 - Allows a Web page to run active content in your computer
    1 - Disallows a Web page from running active content in your computer
    

    This document contains some other related registry keys you may want to look at:

    http://msdn.microsoft.com/en-us/library/ms537183(VS.85).aspx#registry

  • venimus

    I'm not sure you can add a local drive into the Trusted sites zone.

    You have to check the restrictions into the zone and best set it to custom level and enable all options that concern Scripting and ActiveX, because even at the lowest level (of preset settings) there are still restrictions that apply.

    I had a similar problem with IE6 and I could fix it by removing all of the restrictions of the default zone (Internet). If you somehow managed to add the file to trusted sites, you have to set the zone to "custom level" too.

    I think it is this setting that you have to enable for sure:

    Initialize and script ActiveX controls not marked as safe for scripting. - It affects both "marked as unsafe" and "not marked"

  • harrymc

    You could try to verify the IE8 installation by using the Microsoft tool found in:
    How to solve Internet Explorer 8 installation problems.

    This article contains a Fix It button that does general troubleshooting for IE8.

    I quote:

    Problems with installing Internet Explorer 8 can be caused by different issues. That's why there are several troubleshooting methods that you can use to try to resolve your problem.

    To fix this problem automatically, click the Fix this problem link. Then click Run in the File Download dialog box, and follow the steps in this wizard.

    Even if this immediately fixes your problem, you should still reboot and check again. If the problem has returned, then this is probably a GPO problem.

    In addition, I found an interesting thread that may apply:
    After IE8 update- Open File Security Warning for all local execute.

    I quote:

    After taking a lot of time with the registry, the internet, and some alcohol (just kidding), I think I found the source of the problem. :) I am pretty sure that it is the source of it, since I can reproduce my problem by toggling the value of a certain registry key back and forth. Curious? :) OK, here we go:

    The following registry key has been identified to cause the problem: [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Lockdown_Zones\0]

    According to KB182569 (http://support.microsoft.com/kb/182569) this key is responsible for: "Miscellaneous: Launching applications and unsafe files."

    The same article also specifies: "Note Unless stated otherwise, each DWORD value is equal to zero, one, or three. Typically, a setting of zero sets a specific action as permitted, a setting of one causes a prompt to appear, and a setting of three prohibits the specific action."

    I found that if I set "1806" dword value to "0" and then use the task manager to kill the "explorer" task and start it again, the problem had disappeared. If I changed the value back to "1" and killed/started the explorer again, then the problem was back.

    Now I started to search my system for applied GPO's and found one that was setting this value to "1" which means prompt the user. It is set within a GPO under the [User Configuration/Administrative Templates/Windows Components/Internet Explorer/Internet Control Panel/Security Page/Lock-Down Local Machine Zone/Lauching programs and unsafe files] section.

    Like I said, this is the source of my problem and I now know how to fix it. But what is strange to me is that the same GPO applies to IE7 machines and the problem does not surface there. According to description of the GPO, this feature was supported since IE7:

    Launching programs and unsafe filesSetting Path:

    User Configuration/Administrative Templates/Windows Components/Internet Explorer/Internet Control Panel/Security Page/Locked-Down Local Machine ZoneSupported On: At least Internet Explorer 7.0ExplanationThis policy setting controls whether or not the "Open File - Security Warning" prompt is shown when launching executables or other unsafe files.

    For instance, if the user launches an executable from an Intranet file share using Windows Explorer, this setting controls whether or not a prompt is shown before the file is opened.

    If you enable this policy setting and the dropdown box is set to Enable, files will open without a security prompt. If the dropdown box is set to Prompt, a security prompt will be shown before opening the files.

    If you disable this policy setting, files will not be opened.

    If you do not configure this policy setting, users can configure the prompt behavior. By default, execution is blocked in the Restricted Zone, enabled in the Intranet and Local Computer zone, and set to prompt in the Internet and Trusted zones.

    So based on the description of the feature and what I have been experiencing, I have come to the conclusion that IE7 was handling this feature incorrectly and IE8 does finally handle it correctly. This would explain why the update to IE8 caused the feature to appear.

  • KronoS
    1. Start Internet Explorer.
    2. On the Tools menu, click Internet Options.
    3. On the Advanced tab, click Reset.
    4. In the Reset Internet Explorer Settings dialog box, click Reset to confirm.
  • 8088

    The only way around this is to go to Internet Ooptions and place localhost inside the trusted zones, however I really do not recommend this as it can lead to a lot of problems.

    I would recommend you install either Apache, Wamp Server (containing Apache in an easy to use package) or IIS / Web Platform Installer (containing IIS in an easy to use package).

    Then depending on how you set it up, you should be able to access the site through http://computer_name - or set up additional DNS entries for intranet or similar. If you have multiple computers that need to access this script, it will also make updating and everything else a lot simpler.

    Edit -

    Take a look for this setting in Internet Options -

    alt text