some fixes
This commit is contained in:
parent
9ef5a4931e
commit
30c01185fc
@ -23,6 +23,9 @@
|
|||||||
],
|
],
|
||||||
"web_accessible_resources": [
|
"web_accessible_resources": [
|
||||||
"static/wallet.html",
|
"static/wallet.html",
|
||||||
|
"dist/taler-wallet-interaction-loader.js.map",
|
||||||
|
"dist/taler-wallet-interaction-loader.js",
|
||||||
|
"dist/taler-wallet-interaction-support.js.map",
|
||||||
"dist/taler-wallet-interaction-support.js"
|
"dist/taler-wallet-interaction-support.js"
|
||||||
],
|
],
|
||||||
"optional_permissions": [
|
"optional_permissions": [
|
||||||
|
@ -38,6 +38,9 @@
|
|||||||
{
|
{
|
||||||
"resources": [
|
"resources": [
|
||||||
"static/wallet.html",
|
"static/wallet.html",
|
||||||
|
"dist/taler-wallet-interaction-loader.js.map",
|
||||||
|
"dist/taler-wallet-interaction-loader.js",
|
||||||
|
"dist/taler-wallet-interaction-support.js.map",
|
||||||
"dist/taler-wallet-interaction-support.js"
|
"dist/taler-wallet-interaction-support.js"
|
||||||
],
|
],
|
||||||
"matches": [
|
"matches": [
|
||||||
|
@ -62,7 +62,7 @@ interface API {
|
|||||||
}
|
}
|
||||||
interface TalerSupport {
|
interface TalerSupport {
|
||||||
info: Readonly<Info>;
|
info: Readonly<Info>;
|
||||||
api: API;
|
__internal: API;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildApi(config: Readonly<Info>): API {
|
function buildApi(config: Readonly<Info>): API {
|
||||||
@ -161,6 +161,7 @@ function buildApi(config: Readonly<Info>): API {
|
|||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
if (shouldNotRun) return;
|
if (shouldNotRun) return;
|
||||||
|
// FIXME: we can remove this if the script caller send information we need
|
||||||
if (!(document.currentScript instanceof HTMLScriptElement)) return;
|
if (!(document.currentScript instanceof HTMLScriptElement)) return;
|
||||||
|
|
||||||
const url = new URL(document.currentScript.src);
|
const url = new URL(document.currentScript.src);
|
||||||
@ -178,14 +179,14 @@ function start() {
|
|||||||
});
|
});
|
||||||
const taler: TalerSupport = {
|
const taler: TalerSupport = {
|
||||||
info,
|
info,
|
||||||
api: buildApi(info),
|
__internal: buildApi(info),
|
||||||
};
|
};
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
window.taler = taler;
|
window.taler = taler;
|
||||||
|
|
||||||
//default behavior: register on install
|
//default behavior: register on install
|
||||||
taler.api.registerProtocolHandler();
|
taler.__internal.registerProtocolHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
// utils functions
|
// utils functions
|
||||||
|
Loading…
Reference in New Issue
Block a user