0

I am running into an issue specifically with font-awesome and search_index.json while building mkdocs locally with mkdocs build. I understand the issue and why it isnt working, but i am trying to distribute my documentation locally instead of using a webserver which is why i must rely on file:// instead of http. Is there a bypass for this?

I am getting the same result on latest Chrome and Firefox.

The actual issue is Failed to load file:///Users/securisec/guide/site/search/search_index.json: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. which i understand. Wondering if there is a mkdocs config option to allow this when using file://. Based on their docs, i couldnt find someplace to set an additional header

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
securisec
  • 3,435
  • 6
  • 36
  • 63
  • Given it’s the browser that’s disallowing the cross-origin file: request, it doesn’t seem like there’s any way mkdocs could provide to override that blocking. – sideshowbarker Oct 15 '18 at 08:22

1 Answers1

1

No, MkDocs does not and can not provide a workaround for this. The limitation is enforced by the browser. The only workaround would be to disable your browser's security settings, which is not recommended.

This was the issue raised in #871 and the conclusion was:

I took another look at this. Even if we pre-generate the index, that index is still a JSON file which is not accessible with the file:// scheme.

Search is now in a plugin. If you really need this, then you can create your own plugin which uses some other search implementation.

Community
  • 1
  • 1
Waylan
  • 37,164
  • 12
  • 83
  • 109