This project has moved and is read-only. For the latest updates, please go here.

Chrome displays security prevention alert on opening Index.html which is build using Sandcastle.

Topics: Developer Forum, User Forum
Dec 4, 2013 at 8:55 AM
I have built Index.html file using Sandcastle from the .net dll and xml file. If i open the html file in the Google chrome, then the below message is being shown.
"Chrome security prevents access to file-based frame URLs. As such, the TOC will not work with Index.html. Either run this website on a web server, run Chrome with '-- disable-web-security' command line option, or use FireFox or Internet Explorer."

Is there any setting in Sandcastle to prevent/solve this message alert?
Dec 4, 2013 at 4:08 PM
It's a limitation of Chrome when viewing Index.html from the local file system. You won't see that problem if you load it from a web server. For the local file system, the only workaround is as noted in the warning: Run Chrome with the "--disable-web-security" command line option or use FireFox or IE.

Aug 26, 2014 at 3:22 PM
Hi Eric,

I am getting the same error message. When I use NDOC I can open index.html file in Chrome without any problems. Also, I tried using IE 10 and still cannot open the Index.html file (created using Sandcastle) but can open index.html created by NDOC. Index.html (created using Sandcastle) only shows the left side TOC; when I click on any of the nodes, I don't see any document on the right side.

Do you have any suggestions? As a note, the Sandcastle generated CHM file works flawlessly.

Aug 26, 2014 at 5:42 PM
Bear in mind that the index.html generated by SHFB is not equivalent to the one generated by NDoc. The one from NDoc probably works because it isn't displaying the content the same way as the one in SHFB which uses a frame set. The solution for Chrome is given above: Start Chrome with the "-- disable-web-security" command line option. For IE, there's a known issue with certain zoom levels. Resetting the zoom level to 100% or 125% usually gets the content to display.

However, I'd suggest updating your project to use the new VS2013 presentation style. It uses a lightweight TOC which is added to each page and contains only the relevant parts similar to the current MSDN style. Since it doesn't use a frameset, it can be opened locally without any security issues in Chrome and also doesn't have any problems with the zoom level in IE.

Aug 26, 2014 at 9:41 PM
Hi Eric,

Thanks for your quick response.

The Chrome workaround did work but unfortunately the IE one did not. The NDOC generated index.html file has <frameset> and can still display itself well on IE10, Firefox 31 and Chrome 37.0.2062.94 m.

I upgraded to latest SHFB with VS2013 presentation style and the index.html file doesn't seem to behave properly on Chrome. I have 3 namespaces and only one is visible. It works well on IE and Firefox. I guess that's a Chrome issue rather than SHFB.

Aug 27, 2014 at 2:02 AM
The namespaces are all there and the behavior is the same regardless of browser. The root namespace is collapsed when there is no conceptual content. It's fixed in the next release. The workaround for the time being is to either add at least one conceptual topic or enable the Root Namespace container option.

Aug 27, 2014 at 6:17 PM
Hi Eric,

Thank you again. Enabling the Root Namespace option resolves this issue but I fall under another issue which I have described here:

If you have any suggestions please let me know.