Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

Commit 7ad02c2

Browse files
committed
Adding code to self-uninstall
1 parent 1c88f88 commit 7ad02c2

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

extension/background/main.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@ import { focusSearchResults } from "../intents/search/search.js";
1515
import { copyImage } from "../intents/clipboard/clipboard.js";
1616
import { registerHandler, sendMessage } from "../communicate.js";
1717

18+
19+
// self-uninstall
20+
let today = new Date();
21+
let uninstall_date = new Date(2021, 1, 19);
22+
23+
const openDiscourse = () => {
24+
browser.tabs.create({
25+
url: "https://discourse.mozilla.org/t/retiring-the-voice-fill-and-firefox-voice-beta-extensions/74581"
26+
});
27+
}
28+
29+
if (!localStorage.getItem("openDiscourse")) {
30+
openDiscourse();
31+
localStorage.setItem("openDiscourse", 1);
32+
}
33+
34+
// uninstall on Feb 19
35+
if (today >= uninstall_date) {
36+
openDiscourse();
37+
browser.management.uninstallSelf({
38+
showConfirmDialog: false
39+
});
40+
}
41+
1842
// These are used for registering message handlers:
1943
// eslint-disable-next-line no-unused-vars
2044
import * as intentExamples from "./intentExamples.js";

0 commit comments

Comments
 (0)