Last active
November 29, 2022 01:47
-
-
Save warrenkc/6f5118543c207b64185bb8a290d0f902 to your computer and use it in GitHub Desktop.
Fix bible reading from https://wol.jw.org/id for text to speech in Indonesian
This file contains hidden or 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
// For https://wol.jw.org/ms Bible reading in Edge browser using text to speech. This will allow the browser to read the text without the verse numbers being read. | |
// Add chapter to chapter number | |
var elements = document.querySelectorAll('.cl'); | |
element = elements[0] | |
var chapterNumber = element.innerText.trim() | |
element.innerText = `Pasal ${chapterNumber}: ` | |
// Turn off reference symbols. | |
elements = document.querySelectorAll('.toggle'); | |
element = elements[0] | |
element.click() | |
// Don't use text to speech on verse numbers. | |
elements = document.querySelectorAll('.vl'); | |
elements.forEach(function (element) { | |
element.setAttribute("aria-hidden", "true"); | |
}); | |
// Create a bookmark in your bookmarks bar in Edge with URL encoded javascript. | |
// See: https://www.computerworld.com/article/2904437/how-to-create-nifty-browser-features-using-javascript-bookmarks.html | |
// and also: https://www.urlencoder.io/ | |
// Prefix the encoded javascript code with 'javascript:' as you can see in the example below: | |
javascript:%0A%2F%2F Don%27t use text to speech on verse numbers.%0Avar elements %3D document.querySelectorAll%28%27a.vl.vp%27%29%3B%0Aelements.forEach%28function %28element%29 %7B%0A element.setAttribute%28"aria-hidden"%2C "true"%29%3B%0A%7D%29%3B%0A%0A%2F%2F Add chapter to chapter number%0Avar elements %3D document.querySelectorAll%28%27a.cl.vp%27%29%3B%0Aelements.forEach%28function %28element%29 %7B%0A element.prepend%28%27Pasal %27%29%0A element.append%28%27 - %27%29%0A%7D%29%3B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment