-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1735 from aeternity/feature/fix-examples
Fix BrowserRuntime in Firefox and pre-release fixes
- Loading branch information
Showing
35 changed files
with
339 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"ak_2dATVcZ9KJU5a8hdsVtTv21pYiGWiPbmVcU1Pz72FFqpk9pSRR": 100000000000000000000000000000000000000000 | ||
"ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E": 100000000000000000000000000000000000000000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,59 @@ | ||
<template> | ||
<div> | ||
<h3>Wallet WebExtension</h3> | ||
<img src="../public/icons/128.png" alt="Logo"> | ||
<div class="popup"> | ||
<template v-if="popupParameters"> | ||
<h2>Aepp at {{ aeppOrigin }} want to {{ action }}</h2> | ||
<div class="group"> | ||
<div> | ||
<div>Request details</div> | ||
<div>{{ JSON.stringify(popupParameters, null, 2) }}</div> | ||
</div> | ||
|
||
<button @click="() => respond(true)"> | ||
Confirm | ||
</button> | ||
<button @click="() => respond(false)"> | ||
Reject | ||
</button> | ||
</div> | ||
</template> | ||
|
||
<h2 v-else>Wallet WebExtension</h2> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
html { | ||
width: 400px; | ||
height: 400px; | ||
<script> | ||
import browser from 'webextension-polyfill'; | ||
import { unpackTx } from '@aeternity/aepp-sdk'; | ||
export default { | ||
data: () => ({ | ||
aeppOrigin: null, | ||
action: null, | ||
popupId: null, | ||
popupParameters: null, | ||
isResponded: false, | ||
}), | ||
mounted() { | ||
const data = new URL(location).searchParams.get('data'); | ||
if (data != null) { | ||
const { aeppOrigin, action, popupId, ...params } = JSON.parse(data); | ||
if (params.transaction) params.unpackedTx = unpackTx(params.transaction); | ||
this.aeppOrigin = aeppOrigin; | ||
this.action = action; | ||
this.popupId = popupId; | ||
this.popupParameters = params; | ||
window.addEventListener('beforeunload', () => this.respond(false)); | ||
} | ||
}, | ||
methods: { | ||
async respond(response) { | ||
if (this.isResponded) return; | ||
await browser.runtime.sendMessage({ response, popupId: this.popupId }); | ||
this.isResponded = true; | ||
window.close(); | ||
}, | ||
}, | ||
} | ||
</style> | ||
</script> | ||
|
||
<style lang="scss" src="./styles.scss" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.