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.

Issue fork cookies-3366452

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sunlix created an issue. See original summary.

anybody’s picture

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?

sunlix’s picture

I will. Fixing horrible UX is always worth ;)
I am sorry fall 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.

sunlix’s picture

Status: Active » Postponed

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.

anybody’s picture

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.

sunlix’s picture

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.

anybody’s picture

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...

vistree’s picture

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 both versions 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.
anybody’s picture

@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.

anybody’s picture

Status: Postponed » Active

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!

vistree’s picture

@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

anybody’s picture

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...

drubb’s picture

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

You can use this e.g. for modifying classes and attributes (like removing 'target').

anybody’s picture

@sunlix FYI this has just been fixed in 2.x:
https://github.com/jfeltkamp/cookiesjsr/issues/23

The target blank is now removed by default.

I'll open a follow-up to implement a setting for setting this to target blank in Drupal settings.

anybody credited jfeltkamp.

anybody’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.