const postData = { PageURL: location.href, option:'none' } fetch(, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams(postData).toString() }) .then(res => res.json()) .then(files => { // console.log(files) if ('speechSynthesis' in window) { const uttr = new SpeechSynthesisUtterance() uttr.text = files uttr.lang = "ja-JP" uttr.rate = uttr.pitch = uttr.volume = const speakBtn = document.querySelector('#speech-start') const cancelBtn = document.querySelector('#speech-cancel') const pauseBtn = document.querySelector('#speech-pause') const resumeBtn = document.querySelector('#speech-resume') speakBtn.addEventListener('click', function() { window.speechSynthesis.speak(uttr) }) cancelBtn.addEventListener('click', function() { window.speechSynthesis.cancel() }) pauseBtn.addEventListener('click', function() { window.speechSynthesis.pause() }) resumeBtn.addEventListener('click', function() { window.speechSynthesis.resume() }) } }) .catch(error => { console.log(error) });