dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.01k stars 853 forks source link

[Bug] StaticTOC search function does not work on Edge or Firefox #10190

Open carllacan opened 1 week ago

carllacan commented 1 week ago

Describe the bug I've made a documentation site using StaticTOC. The search function does not work at all on Edge (it just reloads the current page) and on Firefox it gets stuck on a loading wheel.

On Edge the console says: "SecurityError: failed to contruct 'Worker': Script at '...' cannot be accessed from origin 'null'

On Firefox I get the following:

Error occurred at search-worker. message: undefined docfx.js:169:17
    onerror docfx.js:169
    (Asíncrono: EventHandlerNonNull)
    webWorkerSearch docfx.js:168
    enableSearch docfx.js:134
    <anonymous> docfx.js:14
    jQuery 13
    O docfx.vendor.min.js:1
    <anonymous> docfx.vendor.js:7
    <anonymous> docfx.vendor.js:17

To Reproduce Steps to reproduce the behavior:

  1. Open the generated doc site.
  2. Try to search for something.

Expected behavior Show the sarch results.

Context (please complete the following information):

Additional context This is a work laptop, so it's possible that some security restrictions imposed by IT are causing this problem.

I'm using the statictoc template, and am accessing the site through the file:// protocol.

filzrev commented 1 week ago

The search function does not work at all on Edge (it just reloads the current page) and on Firefox it gets stuck on a loading wheel.

Are you opening generated HTML file with file:/// protocol ?

As far as I knows. Search functionality is not works when using statictoc template and directory open HTML file without web site hosting.

See: https://github.com/dotnet/docfx/issues/9188

carllacan commented 1 week ago

The search function does not work at all on Edge (it just reloads the current page) and on Firefox it gets stuck on a loading wheel.

Are you opening generated HTML file with file:/// protocol ?

As far as I knows. Search functionality is not works when using statictoc template and directory open HTML file without web site hosting.

See: #9188

I see. Then what is the point of the "static" template, if the static sites it produces do not fully work?