Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] The site doesn't render with firefox addon "BP Privacy Block All Font and Glyph Detection" enable. #1372

Closed
robinmoussu opened this issue May 6, 2019 · 3 comments
Assignees
Labels

Comments

@robinmoussu
Copy link

Everything is in the title. If you enable BP Privacy Block All Font and Glyph Detection addon on firefox, you will see that only the top banner is displayed.

Firefox 66.0.4 - 64 bits - archlinux (up-to-date as of today)

The following error can be found in the console:

jQuery.Deferred exception: document.fonts.values(...) is not iterable getAllowedFontFamily/allowedFonts<@https://godbolt.org/:33:25
getAllowedFontFamily@https://godbolt.org/:26:22
modifiedCssSetProperty@https://godbolt.org/:47:18
recursivelyModifyFonts@https://godbolt.org/:91:5
modifiedAppend@https://godbolt.org/:100:11
i</e.prototype._createDomElements@https://godbolt.org/vs/editor/editor.main.js:31:288960
i</e.prototype.read@https://godbolt.org/vs/editor/editor.main.js:31:288323
t.readCharWidths@https://godbolt.org/vs/editor/editor.main.js:31:290269
h</t._actualReadConfiguration@https://godbolt.org/vs/editor/editor.main.js:31:1063344
h</t.prototype.readConfiguration@https://godbolt.org/vs/editor/editor.main.js:31:1061517
p</t.prototype.readConfiguration@https://godbolt.org/vs/editor/editor.main.js:31:1065781
m</n.prototype._computeInternalOptions@https://godbolt.org/vs/editor/editor.main.js:31:1026768
m</n.prototype._recomputeOptions@https://godbolt.org/vs/editor/editor.main.js:31:1026355
t@https://godbolt.org/vs/editor/editor.main.js:31:1064488
b</t.prototype._createConfiguration@https://godbolt.org/vs/editor/editor.main.js:31:1429263
t@https://godbolt.org/vs/editor/editor.main.js:31:1081315
t@https://godbolt.org/vs/editor/editor.main.js:31:1427562
t@https://godbolt.org/vs/editor/editor.main.js:31:1437433
t@https://godbolt.org/vs/editor/editor.main.js:31:1629917
t@https://godbolt.org/vs/editor/editor.main.js:31:1632026
k/<@https://godbolt.org/vs/editor/editor.main.js:31:1687638
T@https://godbolt.org/vs/editor/editor.main.js:31:1687538
k@https://godbolt.org/vs/editor/editor.main.js:31:1687613
n@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:96:91339
o.prototype.codeEditorFactory@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:96:88855
o/<@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:96:86659
r.items.Component@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:63709
createContentItem@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:28777
_createContentItems@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:62371
r.items.AbstractContentItem@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:57478
r.items.Stack@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:73065
createContentItem@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:28777
_createContentItems@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:62371
r.items.AbstractContentItem@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:57478
r.items.RowOrColumn@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:66494
createContentItem@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:28777
_createContentItems@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:62371
r.items.AbstractContentItem@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:57478
r.items.Root@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:64620
_create@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:34735
init@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:27083
o@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:96:88008
@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:88:108194
h@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:37:25117
s/</d<@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:37:25422
n@https://godbolt.org/dist/bundle.09e22ac59aa5c4a2e41d.js:58:11065
 undefined
@RubenRBS RubenRBS self-assigned this May 6, 2019
@RubenRBS
Copy link
Member

RubenRBS commented May 6, 2019

Thanks for the report :)
I'll see what can be done to stop the site from not working at all with such extensions, because that's totally unintended
Sentry issue: COMPILER-EXPLORER-43V

@apmorton
Copy link
Member

did some investigation on this.

The code triggering the extension is part of monaco. I haven't looked into why monaco is doing this, but I suspect it isn't for telemetry purposes.

However, the actual issue is caused by the extension.
I don't know if the extension would otherwise break the site if it was working correctly, but the extension is simply broken.

The offending line in the extensions source code:

for (var allowed of document.fonts.values())
    if (normalised == allowed) return true

This code just simply doesn't work in firefox.
Try pasting this into the firefox console:

for (var allowed of document.fonts.values()) console.log(allowed);

image

This, however, does work:

for (var allowed of document.fonts) console.log(allowed);

image

I suggest you contact the extension author so they can fix the issue if you intend to continue using it.

I think this issue can be closed (or upstreamed with monaco if you desire).

@robinmoussu
Copy link
Author

robinmoussu commented Jul 15, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants