Added page for Experimental features, with NIP-26 support.

This commit is contained in:
Ryan Breen
2023-02-06 20:45:20 -05:00
parent 2aabd443e1
commit 6c83c24921
14 changed files with 363 additions and 49 deletions

View File

@@ -16,6 +16,7 @@ import {
KINDS,
humanPermission,
validateKey,
feature,
} from './utils';
const log = console.log;
@@ -36,6 +37,7 @@ Alpine.data('options', () => ({
host: '',
permHosts: [],
hostPerms: [],
delegationActive: false,
setPermission,
async init(watch = true) {
@@ -63,7 +65,10 @@ Alpine.data('options', () => ({
// on init to set the correct profile.
await this.getProfileNames();
await this.getProfileIndex();
this.setProfileIndexFromSearch();
await this.refreshProfile();
this.delegationActive = await feature('delegation');
},
async refreshProfile() {
@@ -77,6 +82,15 @@ Alpine.data('options', () => ({
// Profile functions
setProfileIndexFromSearch() {
let p = new URLSearchParams(window.location.search);
let index = p.get('index');
if (!index) {
return;
}
this.profileIndex = parseInt(index);
},
async getProfileNames() {
this.profileNames = await getProfileNames();
},
@@ -98,6 +112,10 @@ Alpine.data('options', () => ({
this.profileIndex = newIndex;
},
newDelegated() {
window.location = browser.runtime.getURL('delegation_wizard.html');
},
async deleteProfile() {
if (
confirm(