![]() |
No. Client Javascripts have been enabled all along. It's definitely the URLInterceptor:
Code:
Debug: Warning: URLInterceptor blocking access to url QUrl("file:///C%3A/Program Files/Sigil/polyfills/MJ/MathJax.js?config=local/SIGIL_EBOOK_MML_SVG") |
I am sure it is drive letter related but it should not be % url encoding related
as that is converted to a local file path before comparison. So in URLInterceptor.cpp, the the following code snippet: Code:
QString destpath = destination.toLocalFile();qDebug() << destpath; qDebug() << mathjaxfolder; I am guessing there is some drive letter case or leading / difference going on. |
Do you want me to push that change and then add [deploy] for you to test with?
|
Actually, I think it may be the way the mathjax folder/url is being concatenated on Windows
Debug: mathjax: "/C:/Program Files/Sigil/polyfills/MJ/" Debug: usercss: "C:/Users/Doug/AppData/Local/sigil-ebook/sigil/" Both are resulting in technically correct urls for the user css file and the mathjax javascript file when all is said and done, but in the case of the mathjax folder: if the URLInterceptor is being told to specifically allow file calls from inside the "/C:/Program Files/Sigil/polyfills/MJ/" folder then that's why it's failing. No such folder exists (that starts with a forward slash). We either build the mathjax folder/url differently for Windows, or we special-case the starts-with section of the URLInterceptor's mathjax exemption on Windows to strip the leading slash |
So the path to the mathjaxfolder is built in MainWindow.cpp Perhaps the bug is there. The mathjax folder should not have a leading "/" in it, right.
From MainWindow.cpp: Code:
#ifdef Q_OS_MACOn Windows I am not so sure. What does QCoreApplicationDirPath() return? But then later on we need to build a file url from it and we do it manually. Maybe that is why the "/" is prepended? Code:
m_mathjaxfolder = mathjaxurl; |
So we could remove the addition of the leading "/" for Windows in the first snippet:
Code:
#ifdef Q_OS_MACCode:
m_mathjaxfolder = mathjaxurl; |
I think should, yes. Let me give it a whirl on Windows and Linux and I'll get back to you.
QCoreApplicationDirPath() returns the folder where the Sigil exe is, by the way. That's also where the poyfill folder is located as well. |
Just tried it and it works fine on MacOS.
|
It fixed things on Windows and continued to work without issue on Linux! Seem a lot cleaner method too.
I'm consistently getting a few errors in inspector related to MathJax on Windows and Linux, though. Are you seeing anything about missing MathMenu.js files and MathZoom.js files? MathJax seems to be looking for them in polyfills/MJ/extensions. The files are definitely not there, I'm just wondering what's looking for them (and if they should be there). |
The MathMenu can not be used was was intentionally removed as it allowed the user to change MathJax settings and it can not be interacted with as Preview is not a Browser.
MathZoom is an accessibility features but Prefix's Zoom takes precedence and so it is unneeded as well. MathJax will dynamically load only those extensions that are present. So we should be good to go. |
Can you push push that MainWindows Mathjax fix with [deploy] or do you want me to do it?
|
I'll take care of it.
I know you've already pushed some bigger changes beyond 1.5.1, so I won't be able to use CI to deploy something on the order of a 1.5.2, but that's fine. This has been broken on Windows since July of last year and this is the first report we've gotten on it! So I don't think there's a huge need. We can definitely hold off until Sigil 1.6. I'll make a patch for the 1.5.1 source for anyone who wants to roll their own, and can make an installer available for @snarkophilus and the few others who might not want to live without the fix. :) This one's on me. I clearly only tested MathJax functionality on my main Linux machine since version 1.2.0, and didn't look any further when it appeared to work. :o Also, I can't seem to recreate the issue I was having on Linux where setting a custom Sigil temp folder was breaking MathJax functionality in 1.5.1. Perhaps I just missed a restart after changing the enable javascript setting :blink: |
Sounds good.
|
Thanks guys for your busy work while I was asleep :)
|
Quote:
It was such a simple change that I replaced the Windows installer packages in the github Sigil 1.5.1 release. Feel free to redownload the installer (don't forget to verify the checksums) and verify that it solves the problem for you. I included a note and the patch for 1.5.1 in the documentation of the release, as well. |
| All times are GMT -4. The time now is 10:54 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.