Opening a CHM file produces: "navigation to the webpage was canceled"

125,520

Solution 1

Summary

Microsoft Security Updates 896358 & 840315 block display of CHM file contents when opened from a network drive (or a UNC path). This is Windows' attempt to stop attack vectors for viruses/malware from infecting your computer and has blocked out the .chm file that draw data over the "InfoTech" protocol, which this chm file uses.

Microsoft's summary of the problem: http://support.microsoft.com/kb/896054

Solutions

  1. If you are using Windows Server 2008, Windows 7, windows has created a quick fix. Right click the chm file, and you will get the "yourfile.chm Properties" dialog box, at the bottom, a button called "Unblock" appears. Click Unblock and press OK, and try to open the chm file again, it works correctly. This option is not available for earlier versions of Windows before WindowsXP (SP3).

  2. Solve the problem by moving your chm file OFF the network drive. You may be unaware you are using a network drive, double check now: Right click your .chm file, click properties and look at the "location" field. If it starts with two backslashes like this: \\epicserver\blah\, then you are using a networked drive. So to fix it, Copy the chm file, and paste it into a local drive, like C:\ or E:. Then try to reopen the chm file, windows does not freak out.

  3. Last resort, if you can't copy/move the file off the networked drive. If you must open it where it sits, and you are using a lesser version of windows like XP, Vista, ME or other, you will have to manually tell Windows not to freak out over this .chm file. HHReg (HTML Help Registration Utility) Utility Automates this Task. Basically you download the HHReg utility, load your .chm file, press OK, and it will create the necessary registry keys to tell Windows not to block it. For more info: http://www.winhelponline.com/blog/fix-cannot-view-chm-files-network-xp-2003-vista/

Windows 8 or 10? --> Upgrade to Windows XP.

Solution 2

"unblocking" the file fixes the problem. Screenshot:

enter image description here

Solution 3

In addition to Eric Leschinski's answer, and because this is stackoverflow, a programmatical solution:

Windows uses hidden file forks to mark content as "downloaded". Truncating these unblocks the file. The name of the stream used for CHM's is "Zone.Identifier". One can access streams by appending :streamname when opening the file. (keep backups the first time, in case your RTL messes that up!)

In Delphi it would look like this:

var f : file;
begin
 writeln('unblocking ',s);
 assignfile(f,'some.chm:Zone.Identifier');
 rewrite(f,1);
 truncate(f);
 closefile(f);
end;

I'm told that on non forked filesystems (like FAT32) there are hidden files, but I haven't gotten to the bottom of that yet.

P.s. Delphi's DeleteFile() should also recognize forks.

Solution 4

Win 8 x64:

just move it to another folder or rename your folder (in my case: my folder was "c#"). avoid to use symbol on folder name. name it with letter.

done.

Solution 5

The definitive solution is to allow the InfoTech protocol to work in the intranet zone.

Add the following value to the registry and the problem should be solved:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000001

More info here: http://support.microsoft.com/kb/896054

Share:
125,520

Related videos on Youtube

Eric Leschinski
Author by

Eric Leschinski

Updated on January 28, 2021

Comments

  • Eric Leschinski
    Eric Leschinski over 3 years

    I am trying to open a .chm file.

    I downloaded the source, extracted it, and double clicked on Waffle.chm and clicked "Open" but no matter what element in the chm file I click, I get the message:

    Navigation to the webpage was canceled.  
    What you can try: 
    Retype the address.  
    

    enter image description here

    What's going on here?

  • Berkyjay
    Berkyjay about 11 years
    I don't see the "Unblock" button either on WinXP SP3 or WinVista Home Premium
  • countunique
    countunique almost 11 years
    Solution 1 is not in Windows 8, is there any easy win8 way?
  • kta
    kta over 10 years
    I have forgotten as I did not use this trick for a long time.Thanks for remind me again.
  • colemik
    colemik over 10 years
    @kaziTanvirAhsan glad I could help.
  • leinad13
    leinad13 over 10 years
    Moving from network location to local location is not enough - you need to unblock like in this screenshot. Thanks @trismarck
  • abstrask
    abstrask about 10 years
    None of the proposed solutions match the 4 possible solutions given my the referenced KB article. Setting 'MaxAllowedZone' to '1' fixed the problem for me
  • klaydze
    klaydze about 10 years
    This works also. My .chm file was in this folder C:\C#\Samples then I moved it to C:\temp and boom! It works! Thanks for this. :)
  • NilsB
    NilsB almost 10 years
    This worked! Thanks. I would have never figured out on my own.
  • tsenapathy
    tsenapathy over 9 years
    Voww... that works for me... ( file right-click, properties didn't show 'unblock' button. Whereas this works fine )
  • ViRuSTriNiTy
    ViRuSTriNiTy about 9 years
    Very interesting answer. Where do i find more information about this hidden file fork thing?
  • Marco van de Voort
    Marco van de Voort about 9 years
    MSDN. E.g. sb made a remark that deletefile works also, and I looked at the relevant call in MSDN and exactly how the function behaves is documented. The specific Zone.Identifier bit I got of the internet. It also works for e.g. blocked dled EXEs if you have high security settings for MSIE
  • tsenapathy
    tsenapathy almost 9 years
    couldn't find such option with win-7. instead of opening a n/w file, I copied to my local machine and it works.
  • Erdinc Ay
    Erdinc Ay over 8 years
    UNBLOCK does not help, you have to open copy the file to a local drive and open it from the (non-network) local drive.
  • Frédéric
    Frédéric over 6 years
    This trouble affects chm downloaded from Internet too. The unblock button/checkbox may not be there right after downloading. In my experience, it requires to first open the chm from local file system, see it wrecked, close it, then only go to file properties for unlocking it.
  • jacktrader
    jacktrader over 5 years
    No problem, I'm glad someone benefited. Best!
  • Marcelo Bergweiler
    Marcelo Bergweiler about 5 years
    Excellent! I am a Windows 10 user: had to remove the "#" both from the file name and the folder name from an old c# chm help file.