Skip to content

Commit 3e8a301

Browse files
committed
docs: update README with enhanced browser options and profile handling for NodeArweaveWallet
1 parent 61f4caa commit 3e8a301

File tree

2 files changed

+70
-57
lines changed

2 files changed

+70
-57
lines changed

README.md

Lines changed: 65 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -81,63 +81,7 @@ const wallet = new NodeArweaveWallet({
8181
})
8282
```
8383

84-
**Browser Options:**
85-
86-
You can specify which browser to open for wallet connection:
87-
88-
```typescript
89-
// Use a specific browser by name
90-
const wallet = new NodeArweaveWallet({ browser: 'chrome' }) // Google Chrome
91-
const wallet = new NodeArweaveWallet({ browser: 'firefox' }) // Firefox
92-
const wallet = new NodeArweaveWallet({ browser: 'safari' }) // Safari (macOS)
93-
const wallet = new NodeArweaveWallet({ browser: 'edge' }) // Microsoft Edge
94-
const wallet = new NodeArweaveWallet({ browser: 'brave' }) // Brave Browser
95-
const wallet = new NodeArweaveWallet({ browser: 'opera' }) // Opera
96-
97-
// Use a custom browser path
98-
const wallet = new NodeArweaveWallet({
99-
browser: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
100-
})
101-
102-
// Disable auto-opening (you'll need to open the URL manually)
103-
const wallet = new NodeArweaveWallet({ browser: false })
104-
```
105-
106-
**Browser Profile Options:**
107-
108-
You can also specify a browser profile to use:
109-
110-
```typescript
111-
// Chrome/Edge/Brave - use profile directory name (NOT the display name!)
112-
const wallet = new NodeArweaveWallet({
113-
browser: 'chrome',
114-
browserProfile: 'Profile 1' // or 'Default', 'Profile 2', etc.
115-
})
116-
117-
// Firefox - use profile name
118-
const wallet = new NodeArweaveWallet({
119-
browser: 'firefox',
120-
browserProfile: 'dev-edition-default' // or your custom profile name
121-
})
122-
```
123-
124-
**Important:** The library automatically resolves display names to directory names for Chrome/Edge/Brave!
125-
126-
- **Chrome/Edge/Brave:** You can use either the display name ("Work") or directory name ("Profile 2")
127-
- **Firefox:** Use the profile name exactly as shown in the profile manager
128-
129-
**How to find your profile name:**
130-
131-
1. **Chrome/Edge/Brave:**
132-
- Open `chrome://version/` (or `edge://version/`, `brave://version/`)
133-
- Look for "Profile Path"
134-
- You can use either:
135-
- The display name shown in the browser UI: `'Work'`, `'Personal'`
136-
- The directory name (last part of path): `'Default'`, `'Profile 1'`, `'Profile 2'`
137-
138-
2. **Firefox:**
139-
- Run `firefox -P` to open the profile manager
140-
- Use the exact profile name shown (e.g., `'default-release'`, `'dev-edition-default'`)
84+
See [Configuration](#️-configuration) for more information.
14185

14286
#### `wallet.initialize()`
14387

@@ -508,6 +452,70 @@ const wallet = new NodeArweaveWallet({
508452

509453
**Note:** The timeout applies to individual wallet operations (signing, encrypting, etc.). If the user doesn't respond within this time, the operation will fail with a timeout error.
510454

455+
**Browser Options:**
456+
457+
You can specify which browser to open for wallet connection:
458+
459+
```typescript
460+
// Use a specific browser by name
461+
const wallet = new NodeArweaveWallet({ browser: 'chrome' }) // Google Chrome
462+
const wallet = new NodeArweaveWallet({ browser: 'firefox' }) // Firefox
463+
const wallet = new NodeArweaveWallet({ browser: 'edge' }) // Microsoft Edge
464+
const wallet = new NodeArweaveWallet({ browser: 'brave' }) // Brave Browser
465+
const wallet = new NodeArweaveWallet({ browser: 'opera' }) // Opera
466+
467+
// Disable auto-opening (you'll need to open the URL manually)
468+
const wallet = new NodeArweaveWallet({ browser: false })
469+
```
470+
471+
**Browser Profile Options:**
472+
473+
You can also specify a browser profile to use:
474+
475+
```typescript
476+
// Chromium-based browsers (Chrome, Edge, Brave, Opera, Vivaldi)
477+
// Use profile directory name OR display name (auto-resolved)
478+
const wallet = new NodeArweaveWallet({
479+
browser: 'chrome',
480+
browserProfile: 'Profile 1' // or 'Default', 'Profile 2', 'Work', 'Personal', etc.
481+
})
482+
483+
// Firefox-based browsers (Firefox, Zen)
484+
// Use profile name exactly as shown in profile manager
485+
const wallet = new NodeArweaveWallet({
486+
browser: 'firefox',
487+
browserProfile: 'dev-edition-default' // or your custom profile name
488+
})
489+
490+
// Opera (Note: Opera doesn't support profile arguments, profile option is ignored)
491+
const wallet = new NodeArweaveWallet({
492+
browser: 'opera'
493+
// browserProfile is not supported for Opera
494+
})
495+
```
496+
497+
**Important:** The library automatically resolves display names to directory names for some Chromium-based browsers!
498+
499+
- **Chrome/Edge/Brave/Vivaldi:** You can use either the display name ("Work") or directory name ("Profile 2")
500+
- **Firefox/Zen:** Use the profile name exactly as shown in the profile manager
501+
- **Opera:** Profile selection is not supported (profile option is ignored)
502+
503+
**How to find your profile name:**
504+
505+
1. **Chrome/Edge/Brave/Vivaldi:**
506+
- Open `chrome://version/` (or `edge://version/`, `brave://version/`, `vivaldi://version/`)
507+
- Look for "Profile Path"
508+
- You can use either:
509+
- The display name shown in the browser UI: `'Work'`, `'Personal'`
510+
- The directory name (last part of path): `'Default'`, `'Profile 1'`, `'Profile 2'`
511+
512+
2. **Firefox/Zen:**
513+
- Run `firefox -P` (or `zen -P`) to open the profile manager
514+
- Use the exact profile name shown (e.g., `'default-release'`, `'dev-edition-default'`)
515+
516+
3. **Opera:**
517+
- Profile selection is not supported by Opera's command-line interface
518+
511519
## 💡 Usage Examples
512520

513521
### CLI Tool Example

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,11 @@ export class NodeArweaveWallet {
10371037
win32: join(home, 'AppData/Local/Microsoft/Edge/User Data'),
10381038
linux: join(home, '.config/microsoft-edge'),
10391039
},
1040+
vivaldi: {
1041+
darwin: join(home, 'Library/Application Support/Vivaldi'),
1042+
win32: join(home, 'AppData/Local/Vivaldi/User Data'),
1043+
linux: join(home, '.config/vivaldi'),
1044+
},
10401045
}
10411046

10421047
return paths[browser]?.[platform] ?? null

0 commit comments

Comments
 (0)