Last active
September 19, 2020 14:32
-
-
Save subtleGradient/663a61bf1e9f04b00dd7943950128dcb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name JW Image focus | |
// @namespace https://gist.github.com/subtleGradient/663a61bf1e9f04b00dd7943950128dcb | |
// @version 1.0.1 | |
// @description Block 3rd party related images when doing Google image searches using site:jw.org | |
// @author Thomas Aylott | |
// @match https://www.google.com/search?* | |
// @grant none | |
// ==/UserScript== | |
;(function(){ | |
const ID = `JW_IMAGE_FOCUS_CSS`; | |
console.log(ID); | |
let el = document.getElementById(ID); | |
if (el) el.parentNode.removeChild(el); | |
document.body.insertAdjacentHTML('beforeend', ` | |
<style id="${ID}"> | |
[data-p*="site:jw.org"]>[data-ved] | |
[data-ved][jsmodel] { | |
overflow: hidden; | |
} | |
[data-p*="site:jw.org"]>[data-ved] | |
a[data-ved][target="_blank"][href]:not([href^="https://www.jw.org"]):not([href^="https://wol.jw.org"]) { | |
background: black; | |
color: transparent; | |
position: relative; | |
padding-top: 999px; | |
margin-top: -999px; | |
pointer-events: none; | |
} | |
[data-p*="site:jw.org"]>[data-ved] | |
a[data-ved][target="_blank"][href]:not([href^="https://www.jw.org"]):not([href^="https://wol.jw.org"]) * { | |
color: transparent; | |
} | |
</style> | |
`); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment