Add site connection permissions, approval flow, and active address
Some checks failed
check / check (push) Has been cancelled
Some checks failed
check / check (push) Has been cancelled
- Add activeAddress, allowedSites, deniedSites, rememberSiteChoice to persisted state - Replace auto-connect with permission checks: allowed sites connect automatically, denied sites are rejected, unknown sites trigger an approval popup - Add approval popup UI with hostname display, active address preview, remember checkbox, and allow/deny buttons - Add ACTIVE/[select] indicator on address rows in the main view to set the active web3 address - Add allowed/denied site list management in settings with delete buttons - Broadcast accountsChanged to connected dapps when active address changes - Handle approval window close as implicit denial
This commit is contained in:
@@ -520,6 +520,22 @@
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="bg-well p-3 mx-1 mb-3">
|
||||
<h3 class="font-bold mb-1">Allowed Sites</h3>
|
||||
<p class="text-xs text-muted mb-2">
|
||||
Sites that can connect to your wallet without asking.
|
||||
</p>
|
||||
<div id="settings-allowed-sites"></div>
|
||||
</div>
|
||||
|
||||
<div class="bg-well p-3 mx-1 mb-3">
|
||||
<h3 class="font-bold mb-1">Denied Sites</h3>
|
||||
<p class="text-xs text-muted mb-2">
|
||||
Sites that are blocked from connecting to your wallet.
|
||||
</p>
|
||||
<div id="settings-denied-sites"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ============ TRANSACTION DETAIL ============ -->
|
||||
@@ -559,18 +575,28 @@
|
||||
|
||||
<!-- ============ APPROVAL ============ -->
|
||||
<div id="view-approve" class="view hidden">
|
||||
<h2 class="font-bold mb-2">A website is requesting access</h2>
|
||||
<div class="mb-2">
|
||||
<h2 class="font-bold mb-2">Connection Request</h2>
|
||||
<div class="mb-3">
|
||||
<p class="mb-2">
|
||||
<span id="approve-hostname" class="font-bold"></span>
|
||||
wants to connect to your wallet.
|
||||
</p>
|
||||
<div class="text-xs text-muted mb-1">
|
||||
From:
|
||||
<span id="approve-origin" class="font-bold"></span>
|
||||
Address that will be shared:
|
||||
</div>
|
||||
<div class="font-bold mb-1" id="approve-type"></div>
|
||||
<div
|
||||
id="approve-address"
|
||||
class="text-xs flex items-center mb-2"
|
||||
></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label
|
||||
class="text-xs flex items-center gap-1 cursor-pointer"
|
||||
>
|
||||
<input type="checkbox" id="approve-remember" checked />
|
||||
Remember my choice for this site
|
||||
</label>
|
||||
</div>
|
||||
<pre
|
||||
id="approve-details"
|
||||
class="border border-border p-2 text-xs overflow-auto mb-3 max-h-64"
|
||||
></pre>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
id="btn-approve"
|
||||
|
||||
Reference in New Issue
Block a user