New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@internetarchive/bookreader

Package Overview
Dependencies
Maintainers
17
Versions
311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@internetarchive/bookreader - npm Package Compare versions

Comparing version 5.0.0-51 to 5.0.0-52

src/util/manifestGenerator.js

5

CHANGELOG.md

@@ -0,4 +1,5 @@

# 5.0.0-52
# 5.0.0-51
- Fix: Bookmark with subfiles was broken
- Feature: Default 1up mode and options.defaults mode override exiting mode
- Fix: Bookmark with subfiles was broken @nsharma123
- Feature: Default 1up mode and options.defaults mode override exiting mode @nsharma123

@@ -5,0 +6,0 @@ # 5.0.0-50

2

package.json
{
"name": "@internetarchive/bookreader",
"version": "5.0.0-51",
"version": "5.0.0-52",
"description": "The Internet Archive BookReader.",

@@ -5,0 +5,0 @@ "repository": {

@@ -74,3 +74,18 @@ /* global br */

/** @override */
getVoices() { return speechSynthesis.getVoices(); }
getVoices() {
const voices = speechSynthesis.getVoices();
if (voices.filter(v => v.default).length != 1) {
// iOS bug where the default system voice is sometimes
// missing from the list
voices.unshift({
voiceURI: 'bookreader.SystemDefault',
name: 'System Default',
// Not necessarily true, but very likely
lang: navigator.language,
default: true,
localService: true,
});
}
return voices;
}

@@ -126,3 +141,7 @@ /** @override */

this.utterance = new SpeechSynthesisUtterance(this.text.slice(this._charIndex));
this.utterance.voice = this.voice;
// iOS bug where the default system voice is sometimes
// missing from the list
if (this.voice?.voiceURI !== 'bookreader.SystemDefault') {
this.utterance.voice = this.voice;
}
// Need to also set lang (for some reason); won't set voice on Chrome@Android otherwise

@@ -129,0 +148,0 @@ if (this.voice) this.utterance.lang = this.voice.lang;

import sinon from 'sinon';
import { WebTTSSound } from '@/src/plugins/tts/WebTTSEngine.js';
import WebTTSEngine, { WebTTSSound } from '@/src/plugins/tts/WebTTSEngine.js';
import { afterEventLoop, eventTargetMixin } from '../../utils.js';

@@ -11,2 +11,3 @@

resume: sinon.stub(),
...eventTargetMixin(),

@@ -25,3 +26,48 @@ };

describe('WebTTSEngine', () => {
test('getVoices should include default voice when no actual default', () => {
// iOS devices set all the voices to default -_-
speechSynthesis.getVoices = () => [
{
default: true,
lang: "ar-001",
localService: true,
name: "Majed",
voiceURI: "com.apple.voice.compact.ar-001.Maged",
},
{
default: true,
lang: "bg-BG",
localService: true,
name: "Daria",
voiceURI: "com.apple.voice.compact.bg-BG.Daria",
}
];
const voices = WebTTSEngine.prototype.getVoices();
expect(voices.length).toBe(3);
expect(voices[0].voiceURI).toBe('bookreader.SystemDefault');
});
test('getVoices should not include default voice when there is a default', () => {
speechSynthesis.getVoices = () => [
{
default: true,
lang: "ar-001",
localService: true,
name: "Majed",
voiceURI: "com.apple.voice.compact.ar-001.Maged",
},
{
default: false,
lang: "bg-BG",
localService: true,
name: "Daria",
voiceURI: "com.apple.voice.compact.bg-BG.Daria",
}
];
const voices = WebTTSEngine.prototype.getVoices();
expect(voices.length).toBe(2);
});
});
describe('WebTTSSound', () => {

@@ -28,0 +74,0 @@ describe('setPlaybackRate', () => {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc