Closed xenithorb closed 6 years ago
I initially thought I had #44 as the issue until I looked at the XHR requests and saw that they were getting 200's no problem. Still, the fonts don't seem to be rendering properly, and I can't seem to save the font size or color
AFAIK I'm not setting any content-security-policy headers in the NGINX config.
There seem to be two things going on here, one being the EPUB renderer trying to set a base href, the other being a font failing to load from a blob: uri due to a missing font-src setting . I can do something about the font-related problem (by adding blob:
to the CSP, it currently contains self
and data
) but not about the base
-related "problem" (which probably does no harm other than specious log spam) as both NC and OC hard-code the base-uri to none
.
If you want to fix the font problem yourself try this patch:
diff --git a/files_reader/lib/Controller/PageController.php b/files_reader/lib/Controller/PageController.php
index 3306292..8a500d1 100644
--- a/files_reader/lib/Controller/PageController.php
+++ b/files_reader/lib/Controller/PageController.php
@@ -115,6 +115,7 @@ class PageController extends Controller {
$policy->addAllowedChildSrcDomain('\'self\'');
$policy->addAllowedFontDomain('\'self\'');
$policy->addAllowedFontDomain('data:');
+ $policy->addAllowedFontDomain('blob:');
$policy->addAllowedImageDomain('blob:');
You can also wait for the next release which will include this change.
Alright that works to get rid of the blob error.
What I'm left with is still not being able to save the fontSize preference, here's the object it's sending:
{
"name": "activeStyles",
"scope": "epubreader",
"lastModified": "1519504848116149",
"id": 2,
"value": {
"fontSize": true,
"nightMode": true
},
"fileId": "0"
}
As far as I can tell it's not sending the server any information about the 104% that I set?
Is this another bug?
A similar object (basically the same) is sent when trying to change one of the colors:
{
"name": "activeStyles",
"scope": "epubreader",
"lastModified": "1519506517447194",
"id": 2,
"value": {
"fontSize": true,
"nightMode": true
},
"fileId": "0"
}
Which is also not being saved. Are font size and custom colors supposed to save? ... The fact that it emits this in the first place kind of indicates that it should.
That is... a bug.
I just checked this and noticed some of the settings do not get registered. I'll look into this for the next release, one of these days.
Got you a new bug to work with. Thanks for addressing this one so quickly!
Joy... just home from abroad and the fun starts... no rest for the wicked it seems.
Fixed in the next release, see https://github.com/Yetangitu/owncloud-apps/issues/82#issuecomment-368262626
Fixed in v.1.2.3
Chromium browser console log:
Returned CSP is as follows:
Versions: