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

Can't read C++ docset when access to *google-analytics.com is blocked #1582

Open
kemlath opened this issue Dec 6, 2023 · 2 comments
Open

Comments

@kemlath
Copy link

kemlath commented Dec 6, 2023

Behind my employers firewall I cannot view certain docsets for instance the C++.docset it just shows me a blank screen.

Trying to open it in firefox revealed the source of the problem:

The allegedly "offline documentation" tries to download a javascript file from *google-analytics.com which would be fine with me in principle BUT when access to *google-analytics.com is blocked the page wont load. It only loads in firefox when the request times out.

The problem is the following part in the documentation html files:

<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script>

Removing it makes the problem go away.

Strangely accessing the "real" online documentation this problem does not appear, I think that this may be due result for the gaJsHost variable in the script above. The script can't properly handle document.location.protocol==file in the offline case.

Also while looking into this I found that the c++ documentation happily excecutes a lot of java script among those scripts one tries to download adds from cdn.carbonads.com which triggers all kinds of cross site scripting exceptions in firefox but I'm not sure what this does in Zeal's qtwebview

@hhartzer
Copy link

hhartzer commented Mar 7, 2024

Very interesting!

This may be another reason to have a flag to disable Javascript. Although I'm not sure if your docset would render at all without it?

#1595

@trollixx
Copy link
Member

trollixx commented Apr 3, 2024

Does this happen in v0.7.0? There were similar issues reported in the past, but I believe migration to Qt WebEngine addressed that. Zeal also now blocks all online access (#955 has more context), so this really should not happen...

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

No branches or pull requests

3 participants