-
Notifications
You must be signed in to change notification settings - Fork 6
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
Detect embedded and skip addons #415
base: main
Are you sure you want to change the base?
Conversation
Check if addons library is being loaded inside an iframe, and skip loading it. Closes #412
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be an option. We have at least one customer on .com that makes use of iframes, where it does need to show the flyout.
Hrm, good point. I don't think we should expose this to users, since it seems to be pretty complex/advanced/confusing and probably not useful for 99% of our users. However, I think we should probably have an option internally for this and enable/disable it via support request.
Do they have public docs where I can see how they are using iframes? |
If I remember correctly, their use case was to load their private documentation using a sharing token from an iframe, probably from inside their application.
We can also expose an option as a query parameter, since the parent page should be the one that decides if the flyout should be shown. This is since users can embed docs they don't have control over. I imagine something like |
I'm not too worried about this case.
I think we want to depend on the user for this. How this approach will solve the current problem we have? The user will need to rebuild all their documentation and probably modify the Sphinx extension's code to add that query attribute --which seems pretty complex for regular users. I think the general rule we were using makes sense, since it follows what we used to have:
That "config that forces addons" will be a META tag as we are doing with other things we want to communicate from the backend, and it will be a field in |
This is required for at least one .com customer.
They just need to update the target URL, that's not complex, they are already providing a URL. And that doesn't require users to ask us to disable the option on docs they don't own. |
I missed typed this. I meant here I think we don't want to depend on the user for this. |
I will add an option in the server that by default skips loading the addons in iframes, but that we can manually force injecting addons for those users requiring this feature. |
Add an extra HTTP header to decide whether or not force the injection of addons when the page is embedded (eg. iframe). By default, we are not loading addons if embedded. Required by readthedocs/addons#415 Closes readthedocs/addons#412
Add an extra addons config to decide whether or not force the injection of addons when the page is embedded (eg. iframe). By default, we are not loading addons if embedded. Required by readthedocs/addons#415 Closes readthedocs/addons#412
I changed the approach here to use |
Add an extra addons config to decide whether or not force the injection of addons when the page is embedded (eg. iframe). By default, we are not loading addons if embedded. Required by readthedocs/addons#415 Closes readthedocs/addons#412
Check if addons library is being loaded inside an iframe, and skip loading it.
Closes #412