mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 14:34:19 +01:00
Use inspectorKey
This commit is contained in:
@@ -62,8 +62,8 @@ customElements.define('devtools-inspector', class extends HTMLElement {
|
||||
import inspector from 'inspector'
|
||||
import { Inspector } from 'pear-inspect'
|
||||
const pearInspector = await new Inspector({ inspector }).enable()
|
||||
const { publicKey } = await pearInspector.enable()
|
||||
console.log('Pear Inspector key:', publicKey.toString('hex'))
|
||||
const { inspectorKey } = await pearInspector.enable()
|
||||
console.log('Pear Inspector key:', inspectorKey.toString('hex'))
|
||||
</div>
|
||||
</li>
|
||||
<li>Running your program and the Pear Inspector key will be logged</li>
|
||||
@@ -97,16 +97,16 @@ customElements.define('devtools-inspector', class extends HTMLElement {
|
||||
|
||||
this.addKeyFormElem.addEventListener('submit', e => {
|
||||
e.preventDefault()
|
||||
const publicKey = this.addKeyInputElem.value
|
||||
if (publicKey.length !== 64) {
|
||||
const inspectorKey = this.addKeyInputElem.value
|
||||
if (inspectorKey.length !== 64) {
|
||||
this.addKeyErrorElem.textContent = 'Key needs to be 64 characters long'
|
||||
return
|
||||
}
|
||||
|
||||
const sessionId = generateUuid()
|
||||
const inspectorSession = new Session({ publicKey: b4a.from(publicKey, 'hex') })
|
||||
const inspectorSession = new Session({ inspectorKey: b4a.from(inspectorKey, 'hex') })
|
||||
const app = {
|
||||
publicKey,
|
||||
inspectorKey,
|
||||
title: '',
|
||||
url: '',
|
||||
inspectorSession
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@holepunchto/pear-inspect": "^2.0.0",
|
||||
"@holepunchto/pear-inspect": "^3.0.0",
|
||||
"b4a": "^1.6.4",
|
||||
"bare-path": "^2.1.0",
|
||||
"redhat-overpass-font": "^1.0.0",
|
||||
"ws": "^8.16.0"
|
||||
|
||||
Reference in New Issue
Block a user