
Loading…
Local mirroring (experimental feature) breaks web fonts #291
This site: http://socialclub.rockstargames.com/games?
I'm trying it, and I don't see font problems. Is there a specific page where the problem occurs?
In case it helps: https://keep.google.com/
Doesn't "break" the page, but the custom fonts
@kurtextrem : Yes, this one I see the problem, and the typical error message at the console:
Redirect at origin 'https://fonts.gstatic.com' has been blocked from loading by Cross-Origin Resource Sharing policy: Received an invalid response. Origin 'https://keep.google.com' is therefore not allowed access.
It's rather technical, but as far as I can make sense of this, it does look like this might solve the problem here: https://code.google.com/p/chromium/issues/detail?id=308768#c29
@CODYQX4 I recently pruned the number of candidate CDNs to mirror, I found this was causing problems -- actually what I pruned was not even CDNs, I just thought it would be safe to mirror them. I really have to stick to mirroring resources which can be safely assumed to be immutable. By disabling/enabling mirroring you forced a flush of the local mirrored resources. Probably you had one which is no longer candidate for mirroring.
Try using object URLs instead of base64 encoded data:URIs.
You can set responseType to blob on the XHR, and create an object URL for the response blob, which can be redirected to (not sure if it will work, just an idea).
I remember reading about object URL, but this sentence turned me away from it:
The URL lifetime is tied to the document in the window on which it was created
Does not quite work for uBlock, as the data is fetched from the background page, and the redirection is done from within the background page context, not the document on which it is meant to be used.
That sentence only tells about the lifetime of the URL. Meaning, the resulted blob: URL will be accessible in the browser until you don't disable the extension (i.e., "close the window") or kill it with revokeObjectURL.
But see for yourself by running this code in the console of the extension's background page:
var xhr = new XMLHttpRequest();
xhr.open('get', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', true);
xhr.onload = function() { console.log(URL.createObjectURL(this.response)); };
xhr.responseType = 'blob';
xhr.send();And open the printed URL in a new tab. Then reload the extension, and refresh the tab (it won't load anymore).
So, the only question is, whether it's possible to redirect requests to a blob: URL.
Hmm, that's right, I guess I am reading that wrong, I had in mind the object URL had to be created on the page for which it was meant to be used.
I will see if that work.
Might be related to https://code.google.com/p/chromium/issues/detail?id=308768, have to look more in details.