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