-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Built-in privacy
plugin does not replace glightbox
plugin's href
#6248
Comments
This issue is related to mkdocs-glightbox, which initially retrieves the |
As said, I've hesitated where to create this issue. If I created it on this repo, that's because your plugin does not promise anything about privacy so its behavior is something normal. But I think this case is interesting: are the theme contributors guarantee some use cases related to the theme features but also to 3rd party plugins if they are mentioned/recommended in the documentation? Speaking about the plugin, maybe it can behave differently depending on theme config? |
Thanks for reporting. We'll look into it.
We cannot guarantee anything when it comes to third-party plugins, as they are not under our control. We do our best to ensure that our plugins work with as many third party plugins as possible. Without looking at it I'm quite confident that we can and should fix this on our side, but I need some time to investigate. I haven't looked at the source of the glightbox plugin yet, but the privacy plugin runs after other plugins that do not need explicit priorities while leaving the possibility for other plugins to run after the privacy plugin. We're using event priorities for that, currently at
I'm not sure what you mean by that. |
Okay I think I know what might be happening. The privacy plugin replaces all external scripts, styles and images that a browser downloads in
It seems that the plugin takes the Thus, I'm not sure whether we can fix it on our side. |
Something like: If config.theme.name == material and privacy in config.plugins and config.plugins.privacy.enabled:
# handle href differently |
Sure, I completely understand with your point of view and I adhere to the underlying principles. |
I've investigated and came to the conclusion that it does not make sense to fix this on our side. Here's why: ProblemThe mkdocs-glightbox plugin currently detects Why? Because if we would start downloading resources that are referenced in Possible solutionIMHO, there's no need for the glightbox plugin to wrap the This would not only solve the problem at hand, but also be easier to extend to other resources to be presented in the ligtbox, because very soon, the optimize plugin will receive the capability to generate multiple variants of images and wrap them in picture tags. The glightbox plugin could the pick the appropriate source in the If you need help getting this to work, @blueswen, let me know. Wrapping an element in JavaScript is quite simple.. Closing as upstream issue. |
Thanks for your time to investigate and your detailed answer. @blueswen I'm not JS good enough to help you on this but if you want, I can create an issue on your repo? |
@Guts Creating an issue on my repo would be great. I'll take some time to address this. @squidfunk Thanks for the detailed information and taking the time to investigate this. I'd love to improve compatibility with Material Theme. |
@blueswen let me know if you want to go down the JavaScript path, and when you run into trouble. Happy to assist. |
Upstream issue created: blueswen/mkdocs-glightbox#25 |
Context
I hesitated before creating this issue because I'm not sure that the privacy plugin has to support other plugins, like glightbox here. But since this plugin is listed in the theme documentation, I thought it was at least interesting to point it out.
cc @blueswen
Bug description
Privacy plugin does not replace image URL in
href
HTML tag added by the glightbox plugin. So, a call to external website is still performed, breaking the privacy behavior and also the offline promise.Related links
Reproduction
9.4.6+insiders.4.42.2-privacy-not-handling-glightbox.zip
Steps to reproduce
Create a mkdocs setup with glighbox and privacy plugins enabled
Write some markdown referencing external image:
Build the website
See the output HTML:
See the network tab reporting calls to external source:
Browser
No response
Before submitting
The text was updated successfully, but these errors were encountered: