Skip to content

Commit

Permalink
Simplify title value
Browse files Browse the repository at this point in the history
  • Loading branch information
dobladov committed Feb 26, 2022
1 parent 61bcaf2 commit 7de45b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/youtube2Anki.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ chrome.runtime.onMessage.addListener(
const cues = [...document.querySelectorAll('.cue-group')]

if (cues.length) {
const title = document.querySelector('h1').firstElementChild.innerText
const title = document.title.replace('- YouTube', '').trim() || 'Untitled'
const subtitles = getSubtitles(cues)
sendResponse({ title, subtitles })
} else {
Expand Down

0 comments on commit 7de45b7

Please sign in to comment.