Downloaded Manual outputs errors after Search #89619
Labels
No Label
legacy module
Rendering & Cycles
legacy module
User Interface
legacy project
Cycles
legacy project
Documentation
legacy project
Infrastructure: blender.org
legacy project
Infrastructure: Blender Web Assets
legacy project
Infrastructure: Websites
legacy project
User Interface
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: infrastructure/blender-org#89619
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Short description of error
After you download an offline copy of the Blender manual and try to search for something, you'll only see titles for results, not the highlighted blurbs of text you see on the website.
Exact steps for others to reproduce the error
Download the manual as web pages (HTML)
linkindex.html
fileSearch docs
input. I searched fornode
.828
errors reported. Each error is a failed ajax request to a local fileAdded subscriber: @Noxx
As a side note. The site calls out
There was no option to set the Tag in the form that was linked, so I had to create the issue, then edit it. Not sure if it's something you're able to add in, but adding a dropdown with available tags or at the least a Tags input may clear up some confusion.
Another note. I was poking around
search.html
andgoogle-analytics
code is being exported with the docs. Can't think of valid reasons why that'd need to be there for offline files.Added subscriber: @Blendify
Changed status from 'Needs Triage' to: 'Resolved'
This is a security feature built-in to most browsers you can get around this by running chrome from the command line with
--allow-file-access-from-files
(there may be a way to do this from chrome settings too)there are other ways around this too such as creating a localhost server. If this is something that matters to you I would either use the command line trick or compile the user manual yourself, see: https://docs.blender.org/manual/en/latest/about/contribute/build/index.htmlhttps://stackoverflow.com/questions/20041656/xmlhttprequest-cannot-load-file-cross-origin-requests-are-only-supported-for-ht
Unfortunately, there is nothing that can be done from the ourside to fix the cors policy issue.
When you have the docs downloaded google analytics won't track you, if you look in the console logs you should see
Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
this is the analytics script being blocked. Because google blocks anything that doesn't come from docs.blender.org here there is no point in removing it for downloaded files. It also would be a lot more work to generate two copies of the documentation.I'm a developer, I'm aware of certain Browser security features.
Depending on how the static pages are generated, extra logic could be added for the offline files to inline files or data into one file so that no external access is required. The JS that's used to search and view results, could then just point to the inlined data.
To that same point, logic could be added to not include extraneous scripts, like analytics.
The tool used to generate the docs is known as Sphinx, the javascript for generating the previews can be found on GitHub: https://github.com/sphinx-doc/sphinx/blob/4.x/sphinx/themes/basic/static/searchtools.js#L280
The analytics is injected by the theme we use which can also be found on GitHub: https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html#L237
If you have ideas on how these can be improved please create patches or tasks in the main repositories for each of the features.