Remove target="_blank" from the cookie doc link or make it configurable

Created on 13 June 2023, over 1 year ago

Problem/Motivation

Currently the cookie documentation links have the HTML attribute target="_blank" which leads to a horrible user expierience. Especially for screenreader user it is not accessible enough. The link does not announce its behavior properly. And target="_blank" opens the new tab / window always at foreground which leads to a hard distraction.

Steps to reproduce

Install Cookies module and place Cookies-UI-Block. Test the cookie doc link.

Proposed resolution

I want to propose to just remove the target="_blank" attribute completly and let the user decide how to navigate.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany sunlix Wesel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sunlix
  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks @sunlix, would you like to prepare a MR?

    Removing it would be a breaking change, so we should be sure it's expected. To make it non-breaking, we could introduce a setting instead and set the default to target="_blank" for existing sites and none for new installations. But I'm not yet totally sure, it's worth it. Further opinions?

  • 🇩🇪Germany sunlix Wesel

    I will. Fixing horrible UX is always worth ;)
    I am sorry fell in some kind of militancy if I see that anti-pattern and can't change it.

    Can you provide some information where the cookie docs link is generated to add the new behavior?
    I have added the new config to the model.

  • Status changed to Postponed over 1 year ago
  • 🇩🇪Germany sunlix Wesel

    I have added a issue on the GitHub queue.

    see https://github.com/jfeltkamp/cookiesjsr/issues/23

    until that it added this issue is blocked. unfortunally.

  • 🇩🇪Germany Anybody Porta Westfalica

    Oh no, it's from the cookiesjsr repo? I didn't have the time to take a closer look, but if that's the case, as it seems, please try to contact JFeltkamp. He disappeared months ago... sadly.

    There was a plan to replace that repo with an open source Vue implementation I was really looking forward to, but no more activity then.

  • Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • @sunlix opened merge request.
  • 🇩🇪Germany sunlix Wesel

    Yep that markup comes from the javascript part.

    At JFeltkamp GitHub repo are both repos:

    React https://github.com/jfeltkamp/cookiesjsr-react
    Vue https://github.com/jfeltkamp/cookiesjsr-vue

    but yeah no activity since november 2022 sadly.

  • 🇩🇪Germany Anybody Porta Westfalica

    I very much hope, he will reply and is still active in the Drupal community. Otherwise, we should ask him to at least fork the Vue repo to proceed working on that. I remember the react repo was proprietary by the company he wrote that for...

  • 🇩🇪Germany vistree

    We have the same problem with the library - _blank should not be used on accessible websites.
    As both projects (vue and non-vue) are on github - can't we just fork them? For the non-vue version, there is a License.txt and it seems to be OK to fork as long we keep correct attribution.

    /** @license CookieJSR v1.0.10
     * cookiejsr.min.js
     * cookiejsr.min.css
     *
     * Copyright (c) Joachim Feltkamp, Hamburg, Germany.
     *
     * This source code is licensed under the CC BY-ND license found in the
     * LICENSE file in the root directory of this source tree.
     */
    
    Source code is licensed under the CC BY-ND license.
    Creative Commons Attribution-NoDerivs 3.0 Germany License.
    https://creativecommons.org/licenses/by-nd/3.0/de/
    
    You are free to:
    
        Share — copy and redistribute the material in any medium or format
        for any purpose, even commercially.
    
        The licensor cannot revoke these freedoms as long as you follow the license terms.
    
    Under the following terms:
    
        Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
        You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
    
        NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.
    
        No additional restrictions — You may not apply legal terms or technological measures that legally restrict others
        from doing anything the license permits.
    
    Notices:
    
        You do not have to comply with the license for elements of the material in the public domain or where your use is
        permitted by an applicable exception or limitation.
        No warranties are given. The license may not give you all of the permissions necessary for your intended use. For
        example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
  • 🇩🇪Germany Anybody Porta Westfalica

    @vistree indeed! Looks like you're right! Sorry I remember a discussion from the early days, where the license was unclear... that was still on my mind!

    Of course the better choice for the COOKiES community would be to finish the Vue implementation and make the changes there, but also for the old one a MR from a fork would be great! and maybe @jfeltkamp will merge it, if you contact him.

  • 🇩🇪Germany Anybody Porta Westfalica

    Let us know about your activity there. @Grevil and I don't have the time to work on this in the next month, but happy to review and merge the Drupal part!

  • 🇩🇪Germany vistree

    @anybody - for my understanding: currently the non-vue version is used in Drupal cookies module, right?
    I am not javascript / vue developer. So I don't know if I am the right person to create a fork. Sure, I can remove all the _blank values. I will try to contact jfeltkamp

  • 🇩🇪Germany Anybody Porta Westfalica

    I have to remove my comment from #10. @Grevil just correct me! https://github.com/jfeltkamp/cookiesjsr/issues/6 only contains the build!
    See https://github.com/jfeltkamp/cookiesjsr/issues/6 and try to contact @JFeltkamp if you'd like to push things forward...

  • 🇩🇪Germany drubb Sindelfingen

    Here's a Gist demonstrating how this can be achieved using a JavaScript mutation observer. Details may vary: https://gist.github.com/drubb/8ef8366a10b24bbddb2ca57e4a7bc075

Production build 0.71.5 2024