Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Adding permissions to stoore samples and bumping to v 1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
andrenatal committed May 20, 2020
1 parent 05daa3f commit 8c0dea4
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ deploy:
on:
repo: mozilla/voicefill
tags: true
branch: 1.4.4
branch: 1.4.5
notifications:
slack:
on_success: always
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Voice Fill Changelog

## [1.4.5] - 2020-05-19
### Added
- Permission settings to allow Mozilla to store the audio samples
### Changed
### Removed
### Fixed


## [1.4.4] - 2019-07-08
### Added
### Changed
Expand Down
2 changes: 1 addition & 1 deletion extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const analytics = new TestPilotGA({
ds: 'addon',
an: 'Voice Fill',
aid: '[email protected]',
av: '1.4.4'
av: '1.4.5'
});

browser.runtime.onMessage.addListener(event => {
Expand Down
12 changes: 11 additions & 1 deletion extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

let LANGUAGES = {};
let LANGUAGE;
let STORESAMPLE = "0";

const languagePromise = fetch(
browser.extension.getURL('languages.json')
Expand All @@ -25,6 +26,13 @@ const languagePromise = fetch(
"en-US";
});

browser.storage.sync.get("storeSample").then((result) => {
STORESAMPLE = result.storeSample || "0";
}).catch((error) => {
STORESAMPLE = "0";
});


(function speak_to_me() {
console.log("Speak To Me starting up...");

Expand Down Expand Up @@ -332,7 +340,7 @@ const languagePromise = fetch(
<div id="stm-footer">
Processing as {language}.
<br>
To change language, navigate to
To change language and permissions, navigate to
<a href="about:addons">about:addons</a>, then click the
Preferences button next to Voice Fill.
</div>
Expand Down Expand Up @@ -714,6 +722,8 @@ const languagePromise = fetch(
headers: {
"Accept-Language-STT": LANGUAGE,
"Product-Tag": "vf",
"Store-Sample": STORESAMPLE,
"Store-Transcription": STORESAMPLE,
}
}).then(response => {
if (!response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Voice Fill",
"version": "1.4.4",
"version": "1.4.5",
"description": "Adds voice input to popular search pages in Firefox. Learn more about Voice Fill at https://testpilot.firefox.com",
"developer": {
"name": "Emerging Technologies Advanced Dev Team",
Expand Down
5 changes: 5 additions & 0 deletions extension/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<select id="language"></select>
<label for="search-provider">Search Provider:</label>
<select id="search-provider"></select>
<label for="store-sample">Allow Mozilla to store audio clips:</label>
<select id="store-sample">
<option value="0">No</option>
<option value="1">Yes</option>
</select>
</form>
</body>
</html>
10 changes: 10 additions & 0 deletions extension/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ function saveOptions(e) {
browser.storage.sync.set({
language: document.querySelector("#language").value,
searchProvider: document.querySelector("#search-provider").value,
storeSample: document.querySelector("#store-sample").value,
});
}

function restoreOptions() {
const languageSelect = document.querySelector("#language");
const providerSelect = document.querySelector("#search-provider");
const sampleSelect = document.querySelector("#store-sample");

let languages;

fetch(browser.extension.getURL("languages.json")).then((response) => {
Expand Down Expand Up @@ -77,8 +80,15 @@ function restoreOptions() {
console.log(`Error: ${error}`);
});

browser.storage.sync.get("storeSample").then((result) => {
sampleSelect.value = result.storeSample || "0";
}).catch((error) => {
console.log(`Error: ${error}`);
});

languageSelect.addEventListener("change", saveOptions);
providerSelect.addEventListener("change", saveOptions);
sampleSelect.addEventListener("change", saveOptions);
}

document.addEventListener("DOMContentLoaded", restoreOptions);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "voicefill",
"id": "[email protected]",
"description": "This is a simple WebExtension that adds support to use Speech To Text as an input method in web pages.",
"version": "1.4.4",
"version": "1.4.5",
"author": {
"name": "Andre Natal & Fabrice Desré",
"url": "https://github.com/mozilla/voicefill"
Expand Down

0 comments on commit 8c0dea4

Please sign in to comment.