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
2 changes: 1 addition & 1 deletion bookmarklets/blur-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Thomas Park
* @authorUrl https://thomaspark.co/2013/11/3-simple-design-bookmarklets-to-improve-your-aesthetics/
* @tags diagnostic
* @pageTest false
* @pageTest self
*/
(function () {
document.body.setAttribute(
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/design-mode-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Christoph Wagner
* @authorUrl https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent#examples
* @tags diagnostic
* @pageTest false
* @pageTest self
*/
document.designMode = document.designMode == "on" ? "off" : "on";
void 0;
2 changes: 1 addition & 1 deletion bookmarklets/disable-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Sarah Higley
* @authorUrl https://dorward.uk/software/disablecss/
* @tags diagnostic
* @pageTest false
* @pageTest self
*/
for (var i = 0; i < document.styleSheets.length; i++) {
void (document.styleSheets.item(i).disabled = true);
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/force-focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @authorUrl https://pauljadam.com/bookmarklets/focus.html
* @tags accessibility, wcag:2.4.7
* @auditing true
* @pageTest false
* @pageTest self
*/
var style = document.createElement("style"),
styleContent = document.createTextNode(
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/grayscale.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Level Access
* @authorUrl https://labs.levelaccess.com/index.php/Grayscale_Favlet
* @tags accessibility, wcag:1.4.1
* @pageTest false
* @pageTest self
*/
(function () {
let style = document.createElement("style");
Expand Down
4 changes: 2 additions & 2 deletions bookmarklets/hide-cursor.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* @bookmarklet Hide cursor
* @description Hides cursor from window to encourage keyboard use
* @description Hides cursor from window to encourage keyboard use (refresh page to reset)
* @author Iain Bean
* @authorUrl https://iainbean.com/posts/2020/an-opinionated-guide-to-accessibility-testing/
* @tags accessibility, wcag:2.1.1, wcag:2.1.2, wcag:2.1.4
* @pageTest false
* @pageTest self
*/
var style = document.createElement("style"),
styleContent = document.createTextNode(
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/isolator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Ian Lloyd
* @authorUrl https://a11y-tools.com/bookmarklets/
* @tags accessibility
* @pageTest false
* @pageTest self
*/
(function () {
"use strict";
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @authorUrl https://a11y-tools.com/bookmarklets/
* @tags accessibility, wcag:2.4.4
* @auditing true
* @pageTest false
* @pageTest self
*/
(function () {
"use strict";
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/service-wave.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author WebAIM
* @authorUrl https://wave.webaim.org/help
* @tags accessibility, external
* @pageTest false
* @pageTest self
*/
void window.open(
"https://wave.webaim.org/report?url=" + escape(window.location)
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/text-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Ashlee M. Boyer
* @authorUrl https://ashleemboyer.com/blog/an-accessibility-bookmarklet-for-testing-200-percent-text-size
* @tags accessibility, wcag:1.4.4
* @pageTest false
* @pageTest self
*/
(function () {
const htmlElement = document.querySelector("html");
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/tool-andi.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @authorUrl https://www.ssa.gov/accessibility/andi/help/install.html
* @tags accessibility, external
* @auditing true
* @pageTest false
* @pageTest self
*/
void (function () {
var andiScript = document.createElement("script");
Expand Down
16 changes: 7 additions & 9 deletions bookmarklets/tool-contrast-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* @author WebAIM
* @authorUrl https://webaim.org/resources/contrastchecker/bookmarklet
* @tags accessibility, external, wcag:1.4.3, wcag:1.4.11
* @pageTest false
* @pageTest self
*/
(function () {
var constrastletelem = document.getElementById("contrastletdragable");
if (constrastletelem == null) {
var contrastletdragable = document.createElement("div");
contrastletdragable.id = "contrastletdragable";
contrastletdragable.style.width = "384px";
contrastletdragable.style.width = "425px";
contrastletdragable.style.position = "absolute";
contrastletdragable.style.right = "20px";
contrastletdragable.style.top = window.pageYOffset + 20 + "px";
Expand Down Expand Up @@ -48,9 +48,9 @@
contrastletdragzone.appendChild(contrastletclose);
var contrastlet = document.createElement("iframe");
contrastlet.src =
"https://webaim.org/resources/contrastchecker/mini?ver=1&a=" +
"https://webaim.org/resources/contrastchecker/mini?ver=2&a=" +
Math.random();
contrastlet.style.width = "380px";
contrastlet.style.width = "421px";
contrastlet.style.height = "368px";
contrastlet.style.margin = "0px";
contrastlet.style.borderStyle = "solid";
Expand All @@ -69,9 +69,7 @@
const dx = e.clientX - x;
const dy = e.clientY - y;
contrastletdragable.style.top = `${contrastletdragable.offsetTop + dy}px`;
contrastletdragable.style.left = `${
contrastletdragable.offsetLeft + dx
}px`;
contrastletdragable.style.left = `${contrastletdragable.offsetLeft + dx}px`;
x = e.clientX;
y = e.clientY;
};
Expand All @@ -90,10 +88,10 @@
contrastletdragable.remove();
}
});
document.addEventListener("securitypolicyviolation", () => {
document.addEventListener("securitypolicyviolation", (e) => {
contrastlet.remove();
var contrastleterrortext = document.createTextNode(
"The Content Security Policy on this page does not allow embedded iframes. The Contrast Checker Bookmarklet cannot run on this page. Press Esc to dismiss this message."
"The Content Security Policy on this page does not allow embedded iframes.The Contrast Checker Bookmarklet cannot run on this page. Press Esc to dismiss this message."
);
contrastletdragable.style.backgroundColor = "#fff";
contrastletdragable.appendChild(contrastleterrortext);
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/tool-html-codesniffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Squiz Labs
* @authorUrl https://squizlabs.github.io/HTML_CodeSniffer/
* @tags accessibility, external
* @pageTest false
* @pageTest self
*/
(function () {
var _p = "//squizlabs.github.io/HTML_CodeSniffer/build/";
Expand Down
2 changes: 1 addition & 1 deletion data/bookmarks.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <H1>Bookmarks Menu</H1>
<DT><A HREF="javascript:void%20(()=%3E%7B(function()%7Bvar%20t=document.createElement(%22script%22);t.setAttribute(%22src%22,%22https://www.ssa.gov/accessibility/andi/andi.js%22),document.body.appendChild(t)%7D)();%7D)();%0A">ANDI</a>
<DT><A HREF="javascript:void%20(()=%3E%7B(function()%7Bvar%20t=document.createElement(%22script%22);t.setAttribute(%22src%22,%22https://thepaciellogroup.github.io/WAI-ARIA-Usage/aria-usage.js%22),document.body.appendChild(t)%7D)();%7D)();%0A">ARIA usage</a>
<DT><A HREF="javascript:void%20(()=%3E%7B(function()%7Bdocument.body.appendChild(document.createElement(%22script%22)).src=%22https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/aria.js%22;for(var%20t=document.getElementsByTagName(%22iframe%22),e=0;e%3Ct.length;e++)t%5Be%5D.contentDocument.body.appendChild(document.createElement(%22script%22)).src=%22https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/aria.js%22%7D)();%7D)();%0A">ARIA</a>
<DT><A HREF="javascript:void%20(()=%3E%7B(function()%7Bvar%20s=document.getElementById(%22contrastletdragable%22);if(s==null)%7Bvar%20e=document.createElement(%22div%22);e.id=%22contrastletdragable%22,e.style.width=%22384px%22,e.style.position=%22absolute%22,e.style.right=%2220px%22,e.style.top=window.pageYOffset+20+%22px%22,e.style.zIndex=%2210000%22,e.style.boxSizing=%22content-box%22;var%20o=document.createElement(%22div%22);o.id=%22contrastletdragzone%22,o.style.width=%22100%25%22,o.style.height=%2215px%22,o.style.cursor=%22move%22,o.style.backgroundColor=%22#0f2c65%22,o.style.boxSizing=%22content-box%22,e.appendChild(o),document.body.appendChild(e);var%20n=document.createElement(%22button%22);n.id=%22contrastletclose%22,n.style.width=%2215px%22,n.style.height=%2215px%22,n.style.float=%22right%22,n.style.padding=%220%22,n.style.border=%220%22,n.style.borderTop=%221px%20solid%20#0f2c65%22,n.style.borderRight=%221px%20solid%20#0f2c65%22,n.setAttribute(%22aria-label%22,%22Close%20Contrast%20Checker%22),n.addEventListener(%22click%22,function()%7Be.remove()%7D,!1);var%20v=document.createTextNode(%22X%22);n.appendChild(v),o.appendChild(n);var%20d=document.createElement(%22iframe%22);d.src=%22https://webaim.org/resources/contrastchecker/mini?ver=1&a=%22+Math.random(),d.style.width=%22380px%22,d.style.height=%22368px%22,d.style.margin=%220px%22,d.style.borderStyle=%22solid%22,d.style.borderColor=%22#0f2c65%22,d.style.boxSizing=%22content-box%22,e.appendChild(d);let%20m=0,u=0,f=function(i)%7Bm=i.clientX,u=i.clientY,document.addEventListener(%22mousemove%22,p),document.addEventListener(%22mouseup%22,y)%7D,p=function(i)%7Blet%20h=i.clientX-m,t=i.clientY-u;e.style.top=%60$%7Be.offsetTop+t%7Dpx%60,e.style.left=%60$%7Be.offsetLeft+h%7Dpx%60,m=i.clientX,u=i.clientY%7D,y=function()%7Bdocument.removeEventListener(%22mousemove%22,p),document.removeEventListener(%22mouseup%22,y)%7D;e.addEventListener(%22mousedown%22,f),document.addEventListener(%22keyup%22,function(i)%7Bi.keyCode===27&&e.remove()%7D),d.addEventListener(%22keyup%22,function(i)%7Bi.keyCode===27&&e.remove()%7D),document.addEventListener(%22securitypolicyviolation%22,()=%3E%7Bd.remove();var%20i=document.createTextNode(%22The%20Content%20Security%20Policy%20on%20this%20page%20does%20not%20allow%20embedded%20iframes.%20The%20Contrast%20Checker%20Bookmarklet%20cannot%20run%20on%20this%20page.%20Press%20Esc%20to%20dismiss%20this%20message.%22);e.style.backgroundColor=%22#fff%22,e.appendChild(i)%7D)%7D%7D)();%7D)();%0A">Contrast checker</a>
<DT><A HREF="javascript:void%20(()=%3E%7B(function()%7Bvar%20v=document.getElementById(%22contrastletdragable%22);if(v==null)%7Bvar%20e=document.createElement(%22div%22);e.id=%22contrastletdragable%22,e.style.width=%22425px%22,e.style.position=%22absolute%22,e.style.right=%2220px%22,e.style.top=window.pageYOffset+20+%22px%22,e.style.zIndex=%2210000%22,e.style.boxSizing=%22content-box%22;var%20o=document.createElement(%22div%22);o.id=%22contrastletdragzone%22,o.style.width=%22100%25%22,o.style.height=%2215px%22,o.style.cursor=%22move%22,o.style.backgroundColor=%22#0f2c65%22,o.style.boxSizing=%22content-box%22,e.appendChild(o),document.body.appendChild(e);var%20i=document.createElement(%22button%22);i.id=%22contrastletclose%22,i.style.width=%2215px%22,i.style.height=%2215px%22,i.style.float=%22right%22,i.style.padding=%220%22,i.style.border=%220%22,i.style.borderTop=%221pxsolid#0f2c65%22,i.style.borderRight=%221pxsolid#0f2c65%22,i.setAttribute(%22aria-label%22,%22CloseContrastChecker%22),i.addEventListener(%22click%22,function()%7Be.remove()%7D,!1);var%20f=document.createTextNode(%22X%22);i.appendChild(f),o.appendChild(i);var%20d=document.createElement(%22iframe%22);d.src=%22https://webaim.org/resources/contrastchecker/mini?ver=2&a=%22+Math.random(),d.style.width=%22421px%22,d.style.height=%22368px%22,d.style.margin=%220px%22,d.style.borderStyle=%22solid%22,d.style.borderColor=%22#0f2c65%22,d.style.boxSizing=%22content-box%22,e.appendChild(d);let%20m=0,u=0,h=function(n)%7Bm=n.clientX,u=n.clientY,document.addEventListener(%22mousemove%22,y),document.addEventListener(%22mouseup%22,s)%7D,y=function(n)%7Blet%20p=n.clientX-m,t=n.clientY-u;e.style.top=%60$%7Be.offsetTop+t%7Dpx%60,e.style.left=%60$%7Be.offsetLeft+p%7Dpx%60,m=n.clientX,u=n.clientY%7D,s=function()%7Bdocument.removeEventListener(%22mousemove%22,y),document.removeEventListener(%22mouseup%22,s)%7D;e.addEventListener(%22mousedown%22,h),document.addEventListener(%22keyup%22,function(n)%7Bn.keyCode===27&&e.remove()%7D),d.addEventListener(%22keyup%22,function(n)%7Bn.keyCode===27&&e.remove()%7D),document.addEventListener(%22securitypolicyviolation%22,n=%3E%7Bd.remove();var%20p=document.createTextNode(%22TheContentSecurityPolicyonthispagedoesnotallowembeddediframes.TheContrastCheckerBookmarkletcannotrunonthispage.PressEsctodismissthismessage.%22);e.style.backgroundColor=%22#fff%22,e.appendChild(p)%7D)%7D%7D)();%7D)();%0A">Contrast checker</a>
<DT><A HREF="javascript:void%20(()=%3E%7B(function()%7Bvar%20n=%22//squizlabs.github.io/HTML_CodeSniffer/build/%22,t=function(o,d)%7Bvar%20e=document.createElement(%22script%22);e.onload=function()%7Be.onload=null,e.onreadystatechange=null,d.call(this)%7D,e.onreadystatechange=function()%7B/%5E(complete%7Cloaded)$/.test(this.readyState)===!0&&(e.onreadystatechange=null,e.onload())%7D,e.src=o,document.head?document.head.appendChild(e):document.getElementsByTagName(%22head%22)%5B0%5D.appendChild(e)%7D,a=%7Bpath:n%7D;t(n+%22HTMLCS.js%22,function()%7BHTMLCSAuditor.run(%22WCAG2AA%22,null,a)%7D)%7D)();%7D)();%0A">HTML CodeSniffer</a>
<DT><A HREF="javascript:void%20(()=%3E%7Bfunction%20o(r)%7Bvar%20e=r.createElement(%22script%22);e.setAttribute(%22src%22,%22https://whatsock.github.io/w3c-alternative-text-computation/Sample%2520JavaScript%2520Recursion%2520Algorithm/recursion.js%22),r.head.appendChild(e),setTimeout(function()%7Bm(r)%7D,500);for(var%20n=%5B%22frame%22,%22iframe%22%5D,t=0;t%3Cn.length;t++)for(var%20a=r.getElementsByTagName(n%5Bt%5D),l=0;l%3Ca.length;l++)try%7Bo(a%5Bl%5D.contentWindow.document)%7Dcatch%7B%7D%7Dfunction%20s(r,e)%7Bvar%20n=e.id;labels=r.getElementsByTagName(%22label%22);for(var%20t=0;t%3Clabels.length;t++)if(labels%5Bt%5D.htmlFor==n)return%20labels%5Bt%5D%7Dfunction%20m(r)%7Bfor(var%20e=r.querySelectorAll(%22button,%20input,%20textarea,%20select,%20%5Btabindex='0'%5D,a%5Bhref%5D,summary%22),n,t,a=0;a%3Ce.length;a++)if(n=%22%22,n=getAccName(e%5Ba%5D),t=%22%22,(e%5Ba%5D.tagName==%22INPUT%22%7C%7Ce%5Ba%5D.tagName==%22SELECT%22%7C%7Ce%5Ba%5D.tagName==%22TEXTAREA%22)&&s(r,e%5Ba%5D)?t=s(r,e%5Ba%5D).textContent:e%5Ba%5D.tagName==%22INPUT%22&&e%5Ba%5D.hasAttribute(%22value%22)?t=e%5Ba%5D.getAttribute(%22value%22):t=e%5Ba%5D.textContent,t=t.trim(),t&&!n.name.includes(t))%7Bvar%20l=document.createElement(%22span%22);l.style.color=%22black%22,l.style.backgroundColor=%22gold%22,l.style.fontSize=%22small%22,l.style.border=%22thin%20solid%20black%22,l.style.position=%22absolute%22,l.appendChild(r.createTextNode(n.name)),e%5Ba%5D.parentNode.insertBefore(l,e%5Ba%5D)%7D%7Do(document);%7D)();%0A">Label in name</a>
<DT><A HREF="javascript:void%20(()=%3E%7B(function(e)%7Be.body.appendChild(e.createElement(%22script%22)).src=%22https://cdn.jsdelivr.net/gh/ryersondmp/sa11y@latest/bookmarklet/sa11y-en.min.js%22%7D)(document);%7D)();%0A">Sa11y</a>
Expand Down