Comments (4)
The privacy plugin downloads assets and stores them locally so that the browser does not access any third-party web server when the user views the page(s). As a result, there is nothing that would interpret the query parameter since the assets are loaded as they are from the hosting web server. I would say that this is the plugin working as intended. That is assuming it has followed the redirect mentioned in your example and stored the file that it actually resolved to?
I am not sure that trying to use the privacy plugin with Google Adsense makes a lot of, um, sense? Are you aiming to reduce the footprint of your site with the exception of that service?
from mkdocs-material.
I observed a great performance improvement when using privacy
to download some of the external assets, especially on mobile devices (as measured by cloudflare and google pagespeed).
You're probably referring to the privacy exception, aren't you?
from mkdocs-material.
That is a side effect of the plugin's function - if the external hosting of the assets is slow. Normally, assets would sit on a CDN and that would improve the performance experienced by most users. For popular assets it would also help increase the chances that they are already cached by the browser. How many assets do you have where your own hosting is faster? It might make sense to manually integrate them into your site instead of asking the privacy plugin to do this?
I don't have much experience with the plugin and the exception clause. It does sound like what you would need to exclude Adsense code from being turned into local assets. Might be the way to go if there are too many assets to deal with manually - of if you want them to be downloaded afresh when you build.
Just looking at the options available, you can also combine the exclude statement with an include one if you want to use the plugin to only download assets from a specific site.
Do let us know if anything is not working. Note that the privacy plugin is marked as experimental.
from mkdocs-material.
The url query parameter is missing and for external services, that results to unintended behavior.
@alexvoss is right – the plugin is working as intended:
The privacy plugin downloads assets and stores them locally so that the browser does not access any third-party web server when the user views the page(s). As a result, there is nothing that would interpret the query parameter since the assets are loaded as they are from the hosting web server.
In order to create discernible URLs for different query parameters, the privacy plugin coerces them to a hash, since query parameters are not evaluated for self-hosted assets (an assumption by the plugin):
mkdocs-material/src/plugins/privacy/plugin.py
Lines 501 to 509 in 5458039
You can use assets_exclude
to instruct the privacy plugin to not process the URL, in order to resolve this issue by a simple configuration change:
plugins:
- privacy:
assets_exclude:
- httpbin.org/*
Additionally, next time, please provide a self-contained minimal reproduction. It is mandatory. With a project of this size, we need to be efficient – we just cannot invest time to keep contents of files stored in different places around. Thank you!
from mkdocs-material.
Related Issues (20)
- Adding projects from submodules leads to some incompatibilities with plugins HOT 5
- hyphen in tag extras file tag list breaks build HOT 6
- Documentation for User Provided Logo not working HOT 1
- Social cards broke after opting in for the insiders program HOT 1
- ⚠️ Social cards broken – update to 9.5.17 HOT 47
- Update Serbian translations HOT 2
- Blog post date-only format HOT 2
- Color palette toggle's keyboard operation is confusing HOT 2
- `content.tooltips` feature breaks abbreviation hover in tab titles HOT 3
- Google font loading breaks build on v9.5.7 (resolved in current release) HOT 1
- Allow title of social cards to respect MkDocs hooks HOT 2
- Mermaid sequence diagram box coloring overridden by material CSS HOT 3
- Search not working in Safari HOT 4
- Group plugin, but for markdown extensions HOT 1
- Code block highlighting issue on mobile resolution HOT 14
- CSS border-radius animation issue on document contributors with Chrome and Edge HOT 8
- Instant preview is enabled on footnotes HOT 8
- Instant previews: default configuration adds previews for all pages HOT 2
- Search is not present when privacy plugin is enabled HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs-material.