Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions bookmarklets/are-ya-hidden.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
o < cs.length;
o++
)
(cssProperty = cs[o]),
((cssProperty = cs[o]),
(cssValue = cs.getPropertyValue(cssProperty)),
"clip" === cssProperty &&
"rect(1px, 1px, 1px, 1px)" === cssValue &&
Expand All @@ -35,7 +35,7 @@
"overflow-y" === cssProperty && "hidden" === cssValue && (l = !0),
"position" === cssProperty && "absolute" === cssValue && (s = !0),
"white-space" === cssProperty && "nowrap" === cssValue && (r = !0),
"width" === cssProperty && "1px" === cssValue && (d = !0);
"width" === cssProperty && "1px" === cssValue && (d = !0));
!0 === a &&
!0 === t &&
!0 === e &&
Expand All @@ -46,22 +46,22 @@
!0 === d &&
i.classList.add("was-visually-hidden");
let c = i.classList;
c.forEach((a) => {
(c.forEach((a) => {
-1 !== a.indexOf("-offscreen") &&
i.classList.add("was-visually-hidden");
}),
(i.classList.contains("sr-only") ||
i.classList.contains("screenreader-only") ||
i.classList.contains("visually-hidden") ||
i.classList.contains("visuallyhidden")) &&
i.classList.add("was-visually-hidden");
i.classList.add("was-visually-hidden"));
});
}
function indicateAriaHiddenElements(i) {
findAllVisuallyHiddenElements();
var a,
t = i.createElement("style");
i.head.appendChild(t),
(i.head.appendChild(t),
(a = t.sheet).insertRule(
"[aria-hidden=true] {background:black;color:black;}",
0
Expand All @@ -70,7 +70,7 @@
a.insertRule(
".was-visually-hidden {clip-path: initial!important;clip: initial!important;height: auto!important;overflow: initial!important;position: initial!important;white-space: initial!important;width: auto!important;opacity:initial!important;z-index:initial!important;background:black!important;color:lime!important;}",
0
);
));
}
indicateAriaHiddenElements(document);
var iframes = document.querySelectorAll("iframe");
Expand Down
24 changes: 12 additions & 12 deletions bookmarklets/grouped-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@
let e = "#662e2e",
l = 0;
function r(e, r) {
(e.style.boxShadow = "0px 0px 0px 10px white"),
((e.style.boxShadow = "0px 0px 0px 10px white"),
(e.style.outline = "5px solid " + r),
(e.style.outlineOffset = "5px"),
l++;
l++);
}
function t(e, l, r) {
let t = document.createElement("span");
(t.innerHTML = l),
((t.innerHTML = l),
(t.style.display = "inline-block"),
(t.style.margin = "20px 0 5px -10px"),
(t.style.padding = "5px"),
(t.style.background = r),
(t.style.fontWeight = "bold"),
(t.style.fontSize = "18px"),
(t.style.color = "white"),
t.classList.add("group-description");
t.classList.add("group-description"));
let o = e.parentNode;
o.insertBefore(t, e);
}
var o,
a = document.querySelectorAll("fieldset");
console.log(a),
(console.log(a),
Array.from(a).forEach((l) => {
console.log(l),
(console.log(l),
r(l, e),
l.querySelector("legend") &&
t(
Expand All @@ -43,7 +43,7 @@
l.querySelector("legend").textContent +
'"',
e
);
));
}),
(e = "#66482e"),
Array.from(
Expand All @@ -53,7 +53,7 @@
).forEach((l) => {
console.log(l);
let o = l.getAttribute("role").toLowerCase();
r(l, e),
(r(l, e),
t(
l,
"Group label (from [role=" +
Expand All @@ -62,7 +62,7 @@
l.getAttribute("aria-label") +
'"',
e
);
));
}),
(e = "#662e43"),
Array.from(
Expand All @@ -74,7 +74,7 @@
let o = l.getAttribute("role").toLowerCase();
r(l, e);
let a = "Source for aria-labelledby is missing/broken";
document.querySelector("#" + l.getAttribute("aria-labelledby")) &&
(document.querySelector("#" + l.getAttribute("aria-labelledby")) &&
(a = document.querySelector(
"#" + l.getAttribute("aria-labelledby")
).textContent),
Expand All @@ -86,9 +86,9 @@
a +
'"',
e
);
));
}),
0 === l && alert("No grouped fields found on this page");
0 === l && alert("No grouped fields found on this page"));
}
outlineGroupedFIelds();
})();
34 changes: 17 additions & 17 deletions bookmarklets/isolator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
if ((t = o.parentNode).tagName) {
i = t.tagName.toLowerCase();
const e = t.querySelectorAll(":scope > " + o.tagName);
(r =
((r =
e.length > 1
? "[" + parseInt(Array.from(e).indexOf(o) + 1) + "]"
: ""),
(a = (n = o.tagName.toLowerCase()) + r + l + a),
(l = "/");
(l = "/"));
}
o = t;
}
return "" === i && (i = n), (a = "//" + i + r + l + a);
return ("" === i && (i = n), (a = "//" + i + r + l + a));
}
function isolate() {
let e,
Expand All @@ -39,7 +39,7 @@
i = !1;
const a = document.querySelectorAll("*");
function r(t, o) {
(e = t), o.stopPropagation(), i || s(t), d(e);
((e = t), o.stopPropagation(), i || s(t), d(e));
}
function l(e) {
e.classList.remove("isolatorHighlight");
Expand All @@ -48,14 +48,14 @@
e.classList.add("isolatorHighlight");
}
function d(e) {
console.clear(), console.log(getXpath(e)), (o.innerHTML = getXpath(e));
(console.clear(), console.log(getXpath(e)), (o.innerHTML = getXpath(e)));
}
Array.from(a).forEach((t) => {
t.addEventListener("click", (o) => {
console.log("preventClicks = ", n),
(Array.from(a).forEach((t) => {
(t.addEventListener("click", (o) => {
(console.log("preventClicks = ", n),
n &&
(!(function (t, o) {
(e = t), "HTML" === t.tagName && (n = !1);
((e = t), "HTML" === t.tagName && (n = !1));
!(function (e) {
if (!i) {
const t = e.parentNode,
Expand All @@ -68,20 +68,20 @@
}
})(t);
})(t),
o.preventDefault());
o.preventDefault()));
}),
t.addEventListener("mouseover", (o) => {
(e = t), o.stopPropagation(), i || s(t), d(e);
((e = t), o.stopPropagation(), i || s(t), d(e));
}),
t.addEventListener("mouseout", (e) => {
l(t);
});
}));
}),
(function () {
const e = document.createElement("style");
(e.textContent =
((e.textContent =
".isolatorHighlight{outline:4px solid black!important;outline-offset:-4px!important;-webkit-box-shadow: 0px 0px 0px 4px #fff; box-shadow: 0px 0px 0px 4px #fff;}#infoPanel {z-index:1000;font-size:20px;background:rgba(0,0,0,0.8);color:#fff;font-weight:bold;padding:10px;position:fixed;bottom:20px;left:20px;font-family:sans-serif;} #infoPanel:empty {visibility:hidden;} #infoPanel code {color:lime}"),
document.head.appendChild(e);
document.head.appendChild(e));
})(),
(o = document.createElement("div")).setAttribute("id", "infoPanel"),
o.setAttribute("role", "status"),
Expand Down Expand Up @@ -112,14 +112,14 @@
l(e);
let t,
o = !1;
Array.from(e.childNodes).forEach((e) => {
(Array.from(e.childNodes).forEach((e) => {
1 !== e.nodeType || o || ((o = !0), (t = e));
}),
t && r((e = t), n);
t && r((e = t), n));
}
"Enter" === n.key && (n.preventDefault(), e.click());
}),
d("Isolator started. Click on element you want to isolate in the DOM");
d("Isolator started. Click on element you want to isolate in the DOM"));
}
isolate();
})();
25 changes: 12 additions & 13 deletions bookmarklets/non-underlined-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
if (
((function () {
const e = document.createElement("style");
(e.textContent =
((e.textContent =
".problem-highlight {outline:5px solid darkred;outline-offset:3px;box-shadow: 0px 0px 0px 10px #fff;}"),
document.head.appendChild(e);
document.head.appendChild(e));
})(),
Array.from(r).forEach((r) => {
if (
Expand All @@ -49,7 +49,6 @@
;
(e = e.parentElement) &&
!(e.matches || e.matchesSelector).call(e, t);

);
return e;
})(r, "nav,[role=navigation]")),
Expand All @@ -60,24 +59,24 @@
"FIGURE" !== r.childNodes[0].tagName.toUpperCase()) ||
(a = !0)),
!(function (n) {
(e = !1), (t = !1), (o = !1);
((e = !1), (t = !1), (o = !1));
const r = getComputedStyle(n);
for (let n = 0; n < r.length; n++) {
const l = r[n],
a = r.getPropertyValue(l);
"text-decoration-line" === l && "underline" === a && (t = !0),
("text-decoration-line" === l && "underline" === a && (t = !0),
"border-bottom-style" !== l ||
("solid" !== a && "dotted" !== a && "dashed" !== a) ||
(o = !0),
"border-bottom-color" === l &&
"transparent" === a &&
(o = !1),
(t || o) && (e = !0);
(t || o) && (e = !0));
}
return e;
})(r) && !a))
) {
(consoleOutput += "-------\n"),
((consoleOutput += "-------\n"),
(consoleOutput += "Link text: " + r.textContent + "\n"),
n ||
(!(function (e) {
Expand All @@ -97,19 +96,19 @@
if ((t = o.parentNode).tagName) {
r = t.tagName.toLowerCase();
const e = t.querySelectorAll(o.tagName);
(a =
((a =
e.length > 1
? "[" + parseInt(Array.from(e).indexOf(o) + 1) + "]"
: ""),
(l = (n = o.tagName.toLowerCase()) + a + s + l),
(s = "/");
(s = "/"));
}
o = t;
}
return "" === r && (r = n), (l = "//" + r + a + s + l);
return ("" === r && (r = n), (l = "//" + r + a + s + l));
})(r) +
"\n"),
l++);
l++));
const e = (function (e, t) {
const o = i(e[0], e[1], e[2]),
n = i(t[0], t[1], t[2]);
Expand All @@ -133,8 +132,8 @@
l > 0)
) {
const e = l + " possible issues with non-underlined links found";
(consoleOutput = e + "\n" + consoleOutput),
alert(e + " (check console for more details)");
((consoleOutput = e + "\n" + consoleOutput),
alert(e + " (check console for more details)"));
} else
alert("No non-underlined links found (outside of a navigation area)");
console.log(consoleOutput);
Expand Down
12 changes: 6 additions & 6 deletions bookmarklets/show-focus-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
);
let t,
o = "";
console.clear(),
(console.clear(),
Array.from(e).forEach(function (e) {
(e.style.transition = "none"),
((e.style.transition = "none"),
e.focus(),
(t = getComputedStyle(e)),
(o = "");
(o = ""));
for (var s = 0; s < t.length; s++)
(cssProperty = t[s]),
((cssProperty = t[s]),
(cssValue = t.getPropertyValue(cssProperty)),
(o += cssProperty + ":" + cssValue + ";");
(o += cssProperty + ":" + cssValue + ";"));
e.setAttribute("style", o);
});
}));
}
showAllFocusStyles();
})();
Loading