我有一个问题,在Firefox中,如果页面自动刷新,语音会被截断,但是在谷歌浏览器中,即使页面是自动刷新的,语音也会结束。我如何解决这个问题,以便即使页面自动刷新也不会在Firefox中被切断?
msg = new SpeechSynthesisUtterance("please finish saying this entire sentence.");
window.speechSynthesis.speak(msg);
(function ($) {
'use strict';
if (window == window.top) {
var body = $('body').empty();
var myframe = $('<iframe>')
.attr({ src: location.href })
.css({ height: '95vh', width: '100%' })
.appendTo(body)
.on('load', function () {
var interval;
interval = 750;
setTimeout(function () {
myframe.attr({ src: location.href });
}, interval);
});
}
})(jQuery);
Run Code Online (Sandbox Code Playgroud)