fix: shorcut for wallet #6592
This commit is contained in:
parent
53c76456c0
commit
9b85d139bf
@ -17,6 +17,11 @@
|
|||||||
"32": "static/img/icon.png",
|
"32": "static/img/icon.png",
|
||||||
"128": "static/img/logo.png"
|
"128": "static/img/logo.png"
|
||||||
},
|
},
|
||||||
|
"commands": {
|
||||||
|
"_execute_browser_action": {
|
||||||
|
"suggested_key": "Alt+W"
|
||||||
|
}
|
||||||
|
},
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"unlimitedStorage",
|
"unlimitedStorage",
|
||||||
"activeTab"
|
"activeTab"
|
||||||
@ -30,7 +35,7 @@
|
|||||||
"default_icon": {
|
"default_icon": {
|
||||||
"32": "static/img/icon.png"
|
"32": "static/img/icon.png"
|
||||||
},
|
},
|
||||||
"default_title": "Taler",
|
"default_title": "GNU Taler Wallet",
|
||||||
"default_popup": "static/popup.html"
|
"default_popup": "static/popup.html"
|
||||||
},
|
},
|
||||||
"background": {
|
"background": {
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
"scripting",
|
"scripting",
|
||||||
"alarms"
|
"alarms"
|
||||||
],
|
],
|
||||||
|
"commands": {
|
||||||
|
"_execute_action": {
|
||||||
|
"suggested_key": "Alt+W"
|
||||||
|
}
|
||||||
|
},
|
||||||
"optional_permissions": [
|
"optional_permissions": [
|
||||||
"webRequest"
|
"webRequest"
|
||||||
],
|
],
|
||||||
@ -27,7 +32,7 @@
|
|||||||
"default_icon": {
|
"default_icon": {
|
||||||
"32": "static/img/icon.png"
|
"32": "static/img/icon.png"
|
||||||
},
|
},
|
||||||
"default_title": "Taler",
|
"default_title": "GNU Taler Wallet",
|
||||||
"default_popup": "static/popup.html"
|
"default_popup": "static/popup.html"
|
||||||
},
|
},
|
||||||
"background": {
|
"background": {
|
||||||
|
@ -304,7 +304,7 @@ function registerOnInstalled(callback: () => void): void {
|
|||||||
// This needs to be outside of main, as Firefox won't fire the event if
|
// 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.
|
// the listener isn't created synchronously on loading the backend.
|
||||||
chrome.runtime.onInstalled.addListener((details) => {
|
chrome.runtime.onInstalled.addListener((details) => {
|
||||||
console.log("onInstalled with reason", details.reason);
|
console.log(`onInstalled with reason: "${details.reason}"`);
|
||||||
if (details.reason === chrome.runtime.OnInstalledReason.INSTALL) {
|
if (details.reason === chrome.runtime.OnInstalledReason.INSTALL) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,9 @@ import * as wallet from "./wallet/index.stories.js";
|
|||||||
import * as cta from "./cta/index.stories.js";
|
import * as cta from "./cta/index.stories.js";
|
||||||
import * as components from "./components/index.stories.js";
|
import * as components from "./components/index.stories.js";
|
||||||
import { strings } from "./i18n/strings.js";
|
import { strings } from "./i18n/strings.js";
|
||||||
|
import { setupPlatform } from "./platform/api.js";
|
||||||
|
import chromeAPI from "./platform/chrome.js";
|
||||||
|
import firefoxAPI from "./platform/firefox.js";
|
||||||
|
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
const lang = url.searchParams.get("lang") || "en";
|
const lang = url.searchParams.get("lang") || "en";
|
||||||
@ -441,3 +444,15 @@ function setupLiveReload(port: number, onReload: () => void): void {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isFirefox = typeof (window as any)["InstallTrigger"] !== "undefined";
|
||||||
|
|
||||||
|
//FIXME: create different entry point for any platform instead of
|
||||||
|
//switching in runtime
|
||||||
|
if (isFirefox) {
|
||||||
|
console.log("Wallet setup for Firefox API");
|
||||||
|
setupPlatform(firefoxAPI);
|
||||||
|
} else {
|
||||||
|
console.log("Wallet setup for Chrome API");
|
||||||
|
setupPlatform(chromeAPI);
|
||||||
|
}
|
||||||
|
@ -27,6 +27,7 @@ import { SubTitle, Title } from "../components/styled/index.js";
|
|||||||
import { useTranslationContext } from "../context/translation.js";
|
import { useTranslationContext } from "../context/translation.js";
|
||||||
import { useDiagnostics } from "../hooks/useDiagnostics.js";
|
import { useDiagnostics } from "../hooks/useDiagnostics.js";
|
||||||
import { useExtendedPermissions } from "../hooks/useExtendedPermissions.js";
|
import { useExtendedPermissions } from "../hooks/useExtendedPermissions.js";
|
||||||
|
import { platform } from "../platform/api.js";
|
||||||
|
|
||||||
export function WelcomePage(): VNode {
|
export function WelcomePage(): VNode {
|
||||||
const [permissionsEnabled, togglePermissions] = useExtendedPermissions();
|
const [permissionsEnabled, togglePermissions] = useExtendedPermissions();
|
||||||
@ -61,8 +62,33 @@ export function View({
|
|||||||
</Title>
|
</Title>
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
<i18n.Translate>Thank you for installing the wallet.</i18n.Translate>
|
<i18n.Translate>
|
||||||
|
You can open the GNU Taler Wallet using the combination{" "}
|
||||||
|
<pre style="font-weight: bold; display: inline;"><ALT+W></pre>
|
||||||
|
.
|
||||||
|
</i18n.Translate>
|
||||||
</p>
|
</p>
|
||||||
|
{!platform.isFirefox() && (
|
||||||
|
<Fragment>
|
||||||
|
<p>
|
||||||
|
<i18n.Translate>
|
||||||
|
Also pinning the GNU Taler Wallet to your Chrome browser allows
|
||||||
|
you to quick access without keyboard:
|
||||||
|
</i18n.Translate>
|
||||||
|
</p>
|
||||||
|
<ol style={{ paddingLeft: 40 }}>
|
||||||
|
<li>
|
||||||
|
<i18n.Translate>Click the puzzle icon</i18n.Translate>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i18n.Translate>Search for GNU Taler Wallet</i18n.Translate>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i18n.Translate>Click the pin icon</i18n.Translate>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
<SubTitle>
|
<SubTitle>
|
||||||
<i18n.Translate>Permissions</i18n.Translate>
|
<i18n.Translate>Permissions</i18n.Translate>
|
||||||
</SubTitle>
|
</SubTitle>
|
||||||
|
Loading…
Reference in New Issue
Block a user