installation popup in FF

This commit is contained in:
Florian Dold 2019-11-02 00:46:57 +01:00
parent 574e6ce37c
commit d6a3a54d28
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
4 changed files with 18 additions and 11 deletions

View File

@ -4,8 +4,8 @@
"name": "GNU Taler Wallet (git)",
"description": "Privacy preserving and transparent payments",
"author": "GNU Taler Developers",
"version": "0.6.69",
"version_name": "0.6.0pre2",
"version": "0.6.70",
"version_name": "0.6.0pre3",
"minimum_chrome_version": "51",
"minimum_opera_version": "36",

View File

@ -23,7 +23,7 @@
/**
* Imports.
*/
import {wxMain} from "./wxBackend";
import { wxMain } from "./wxBackend";
window.addEventListener("load", () => {
wxMain();

View File

@ -88,7 +88,7 @@ function TipDisplay(props: { talerTipUri: string }) {
</p>
<form className="pure-form">
<ProgressButton loading={loading} onClick={() => accept()}>
AcceptTip
Accept Tip
</ProgressButton>
{" "}
<button className="pure-button" type="button" onClick={() => discard()}>

View File

@ -547,19 +547,26 @@ function injectScript(
});
}
try {
// This needs to be outside of main, as Firefox won't fire the event if
// the listener isn't created synchronously on loading the backend.
chrome.runtime.onInstalled.addListener(details => {
console.log("onInstalled with reason", details.reason);
if (details.reason === "install") {
const url = chrome.extension.getURL("/src/webex/pages/welcome.html");
chrome.tabs.create({ active: true, url: url });
}
});
} catch (e) {
console.error(e);
}
/**
* Main function to run for the WebExtension backend.
*
* Sets up all event handlers and other machinery.
*/
export async function wxMain() {
chrome.runtime.onInstalled.addListener(details => {
if (details.reason === "install") {
const url = chrome.extension.getURL("/src/webex/pages/welcome.html");
chrome.tabs.create({ active: true, url: url });
}
});
// Explicitly unload the extension page as soon as an update is available,
// so the update gets installed as soon as possible.
chrome.runtime.onUpdateAvailable.addListener(details => {