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
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@

<div id="one"></div>
<div id="two"></div>
<div id="three"><img src="https://picsum.photos/300/200" alt="" style="width: 300px;height: 200px;margin: 1rem;"></div>
26 changes: 26 additions & 0 deletions bookmarklets/background-image-hide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @bookmarklet Background image hide
* @description Hide all CSS background images
* @author Zoe Mickley Gillenwater
* @authorUrl https://zomigi.com/blog/bookmarklets-for-accessibility-testing/
* @tags utility
* @pageTest true
*/
(function () {
var tags = document.getElementsByTagName("*");
var element;
for (var i = 0; i < tags.length; i++) {
element = tags[i];
if (element.currentStyle) {
if (element.currentStyle["backgroundImage"] !== "none")
element.style.backgroundImage = "none";
} else if (window.getComputedStyle) {
if (
document.defaultView
.getComputedStyle(element, null)
.getPropertyValue("background-image") !== "none"
)
element.style.backgroundImage = "none";
}
}
})();
15 changes: 15 additions & 0 deletions bookmarklets/background-image-highlight.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<style>
#one, #two {
background-image: url("https://picsum.photos/300/200");
background-repeat: no-repeat;
background-size: contain;
background-position: center;
width: 300px;
height: 200px;
margin: 1rem;
}
</style>

<div id="one"></div>
<div id="two"></div>
<div id="three"><img src="https://picsum.photos/300/200" alt="" style="width: 300px;height: 200px;margin: 1rem;"></div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @bookmarklet Background images
* @bookmarklet Background image highlight
* @description Highlight all CSS background images
* @author Zoe Mickley Gillenwater
* @authorUrl https://zomigi.com/blog/bookmarklets-for-accessibility-testing/
Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/test-csp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ document.addEventListener("securitypolicyviolation", cspCheck, false);
var testScript = document.createElement("script");
testScript.setAttribute(
"src",
"https://jsnmrs.github.io/bookmarklets/bookmarklets/test-js-external.js"
"https://code.jasonmorris.com/bookmarklets/bookmarklets/test-js-external.js"
);
document.body.appendChild(testScript);

Expand Down
2 changes: 1 addition & 1 deletion bookmarklets/truncation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @description Identify instances of text-overflow: ellipsis
* @author Jason Morris
* @authorUrl https://jasonmorris.com
* @tags accessibility
* @tags accessibility, wcag:1.4.10
* @pageTest true
*/
(function () {
Expand Down
5 changes: 3 additions & 2 deletions data/bookmarks.html

Large diffs are not rendered by default.