PageSourceSearch

https://www.rueschenbeck.de/bundles/devkollektivaccessibility/features/new-window-hint.js?1790252963

js rueschenbeck.de collected 2026-10-06 16:15:34 UTC 1,281 bytes, 39 lines download raw bytes

1(function () {
2    'use strict';
3
4    var MARKER = 'data-devk-a11y-new-window';
5    var DEFAULT_TEXT = 'Öffnet in einem neuen Fenster';
6
7    if (!window.devkA11y) {
8        return;
9    }
10
11    window.devkA11y.register('newWindowHint', {
12        init: function (options) {
13            var text = options.text || DEFAULT_TEXT;
14            var links = document.querySelectorAll('a[target="_blank"]:not([' + MARKER + '])');
15            var index, link, rel, hint;
16
17            for (index = 0; index < links.length; index += 1) {
18                link = links[index];
19                link.setAttribute(MARKER, '');
20
21                rel = link.getAttribute('rel') || '';
22
23                if (rel.indexOf('noopener') === -1) {
24                    link.setAttribute('rel', ('' === rel ? '' : rel + ' ') + 'noopener');
25                }
26
27                if (link.getAttribute('aria-label')) {
28                    link.setAttribute('aria-label', link.getAttribute('aria-label') + ', ' + text);
29                    continue;
30                }
31
32                hint = document.createElement('span');
33                hint.className = 'devk-a11y-visually-hidden';
34                hint.textContent = ' (' + text + ')';
35                link.appendChild(hint);
36            }
37        }
38    });
39}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.