aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/audio.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/audio.js')
-rw-r--r--ext/bg/js/audio.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js
index 0ecfd5c4..972e2b8b 100644
--- a/ext/bg/js/audio.js
+++ b/ext/bg/js/audio.js
@@ -52,7 +52,7 @@ const audioUrlBuilders = new Map([
for (const row of dom.getElementsByClassName('dc-result-row')) {
try {
const url = row.querySelector('audio>source[src]').getAttribute('src');
- const reading = row.getElementsByClassName('dc-vocab_kana').item(0).innerText;
+ const reading = row.getElementsByClassName('dc-vocab_kana').item(0).textContent;
if (url && reading && (!definition.reading || definition.reading === reading)) {
return audioUrlNormalize(url, 'https://www.japanesepod101.com', '/learningcenter/reference/');
}
@@ -156,8 +156,8 @@ function audioBuildFilename(definition) {
async function audioInject(definition, fields, sources, optionsContext) {
let usesAudio = false;
- for (const name in fields) {
- if (fields[name].includes('{audio}')) {
+ for (const fieldValue of Object.values(fields)) {
+ if (fieldValue.includes('{audio}')) {
usesAudio = true;
break;
}