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