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

Cookie consent window keeps appearing on local use (file:// protocol) with Firefox #3202

Closed
5 tasks done
wilhelmer opened this issue Nov 8, 2021 · 4 comments
Closed
5 tasks done
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@wilhelmer
Copy link
Contributor

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

When accessing the output locally (file:// protocol) with Firefox (v94, Windows), the cookie consent window keeps reappearing on each page.

The setting is stored for each page individually, so if you go to topic A, click Accept, and switch to topic B, you will have to click Accept again. If you then return to topic A, the consent window won't show on that page. But the setting isn't stored globally.

I suggest to never display the cookie consent window at all on local use. I don't think the GDPR stuff applies to content that is on your own hard disk. Also, GA doesn't work anyway when the content is accessed via file protocol.

Expected behaviour

The cookie consent window shouldn't reappear after switching pages, or never appear at all.

Actual behaviour

Cookie consent window keeps reappearing on each page.

Steps to reproduce

  1. Enable the cookie consent feature.
  2. Open topic A. Cookie window appears.
  3. Click "Accept".
  4. Switch to topic B. Cookie window appears again.

Package versions

  • Python: 3.9.4
  • MkDocs: mkdocs, version 1.2.3
  • Material: Version: 7.3.6+insiders.3.2.0

Configuration

site_name: My Docs
theme:
  name: material
use_directory_urls: false
extra:
    # Analytics and cookie consent
    analytics:
        provider: google
        property: UA-xxxxxx
    consent:
        title: This website uses cookies
        description: >
            We use cookies to recognize your repeated visits and preferences, as well
            as to measure the effectiveness of our documentation and whether users
            find what they're searching for. With your consent, you're helping us to
            make our documentation better.

System information

  • Operating system: Windows
  • Browser: Firefox 94
@wilhelmer wilhelmer changed the title Cookie consent windows keeps appearing on local use (file:// protocol) with Firefox Cookie consent window keeps appearing on local use (file:// protocol) with Firefox Nov 8, 2021
@squidfunk
Copy link
Owner

Thanks for reporting

I suggest to never display the cookie consent window at all on local use. I don't think the GDPR stuff applies to content that is on your own hard disk. Also, GA doesn't work anyway when the content is accessed via file protocol.

I agree, as we can't make XHR calls anyway, so there's nothing to be worried about.

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Nov 8, 2021
@squidfunk
Copy link
Owner

I've tried reproducing the issue with Firefox, but I didn't manage to. For me, the consent goes aways after I accepted it. However, showing it during local browsing makes no sense. Fixed in da3540999.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Nov 9, 2021
@wilhelmer
Copy link
Contributor Author

Might be because I have strict mode enabled in Firefox. The strict mode settings don't show up during local browsing, so I thought it doesn't matter. But maybe it does. Anyway, thanks for fixing.

@squidfunk
Copy link
Owner

The fix was just released as part of 7.3.6-insiders-3.2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants