Skip to content

Commit

Permalink
release: v1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Sep 3, 2024
1 parent b2c7ce4 commit 4e1fd90
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.7.1 (3 Sep 2024)

* fix: error caused by accessing object properties

## 1.7.0 (28 Aug 2024)

* feat: support latest devtools
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chobitsu",
"version": "1.7.0",
"version": "1.7.1",
"description": "Chrome devtools protocol JavaScript implementation",
"main": "dist/chobitsu.js",
"exports": {
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ chobitsu.register('CSS', {
})
chobitsu.register('Debugger', {
...Debugger,
getPossibleBreakpoints: noop,
setBreakpointByUrl: noop,
setBreakpointsActive: noop,
setAsyncCallStackDepth: noop,
setBlackboxPatterns: noop,
setPauseOnExceptions: noop,
Expand Down
3 changes: 1 addition & 2 deletions src/lib/objManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import isErr from 'licia/isErr'
import isMap from 'licia/isMap'
import isSet from 'licia/isSet'
import isRegExp from 'licia/isRegExp'
import getType from 'licia/type'
import getKeys from 'licia/keys'
import toSrc from 'licia/toSrc'
import allKeys from 'licia/allKeys'
import isNative from 'licia/isNative'
import getProto from 'licia/getProto'
import isSymbol from 'licia/isSymbol'
import has from 'licia/has'
import { getType, has } from './util'

const objects = new Map()
const objectIds = new Map()
Expand Down
18 changes: 18 additions & 0 deletions src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import startWith from 'licia/startWith'
import Url from 'licia/Url'
import convertBin from 'licia/convertBin'
import axios from 'axios'
import _type from 'licia/type'
import _has from 'licia/has'

const prefix = random(1000, 9999) + '.'

Expand Down Expand Up @@ -55,6 +57,22 @@ export async function getBase64Content(url: string, proxy = '') {
return convertBin(await getContent(url, 'arraybuffer', proxy), 'base64')
}

export function getType(val: any, lowerCase: boolean) {
try {
return _type.apply(null, [val, lowerCase])
} catch (e) {
return 'Error'
}
}

export function has(obj: any, key: string) {
try {
return _has.apply(null, [obj, key])
} catch (e) {
return false
}
}

async function getContent(url: string, responseType: any, proxy = '') {
try {
const urlObj = new Url(url)
Expand Down

0 comments on commit 4e1fd90

Please sign in to comment.