Skip to content

Commit

Permalink
feat: add test demo and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-void0 committed Jan 18, 2024
1 parent 3d79e1d commit c3e047a
Show file tree
Hide file tree
Showing 9 changed files with 413 additions and 117 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/pages.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/publish.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/release.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
# install playwright binary manually (because pnpm only runs install script once)
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"

Check warning on line 8 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / Lint: node-LTS, ubuntu-latest

Replace `"1"` with `'1'`
# Vitest auto retry on flaky segfault
VITEST_SEGFAULT_RETRY: 3

Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
node_version: 18
fail-fast: true

name: 'Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"

Check warning on line 41 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / Lint: node-LTS, ubuntu-latest

Replace `"Build&Test:·node-${{·matrix.node_version·}},·${{·matrix.os·}}"` with `'Build&Test:·node-${{·matrix.node_version·}},·${{·matrix.os·}}'`

steps:
- name: Checkout
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
name: 'Lint: node-LTS, ubuntu-latest'
name: "Lint: node-LTS, ubuntu-latest"

Check warning on line 96 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / Lint: node-LTS, ubuntu-latest

Replace `"Lint:·node-LTS,·ubuntu-latest"` with `'Lint:·node-LTS,·ubuntu-latest'`
steps:
- uses: actions/checkout@v4
with:
Expand Down
11 changes: 10 additions & 1 deletion RADEME-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ instance.open();

# API

`FakeFingerPrint`的参数.
## `FakeFingerPrint`的参数.

| 名称 | 描述 | 类型 | 是否必须 |
| :--------: | :----------------------------------------------------: | :------: | :------: |
Expand All @@ -94,6 +94,15 @@ instance.open();
| webGL | 返回渲染的设备信息 | {driver: "ANGLE (NVIDIA GeForce GTX 1050 Ti Direct3D11 vs_5_0 ps_5_0)"} |
| webRTC | 自定义的ip地址信息 | {address:"127.0.0.1"} |

## `实例属性`.

| 名称 | 描述 | 类型 | 示例 |
| :-----------: | :--------------------------------------------------: | :------: | :-----------------------------------------------------: |
| open | 开启虚假指纹的配置,如果不指定参数,默认开启所有配置 | function | instance.open(['navigator','canvas']) |
| close | 关闭虚假指纹的配置,如果不指定参数,默认开启所有配置 | function | instance.close(['navigator','canvas']) |
| set | 设置虚假指纹的配置 | function | instance.set({ navigator: { userAgent: 'Custom UA' } }) |
| getKeysStatus | 获取当前配置的类别使用情况 | function | {close:['navigator','canvas'],open:['canvas','webGL']} |

# 证书

MIT [@hemengke1997](https://github.com/hemengke1997)
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ instance.open();

# API

arguments of `FakeFingerPrint`.
## `Arguments of FakeFingerPrint`.

| name | explain | type | required |
| :--------: | :--------------------------------------------------------: | :------: | :------: |
| config | generate the configuration fake uses | object | no |
| report | when property or function to be visit. It‘s will be invoke | function | yes |
| reportKeys | need keys of report. default null, will report all keys | key[] | no |

`config`:
`Config`:

| name | explain | example |
| :-------: | :-------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------: |
Expand All @@ -94,6 +94,15 @@ arguments of `FakeFingerPrint`.
| webGL | reutrn driver of information | {driver: "ANGLE (NVIDIA GeForce GTX 1050 Ti Direct3D11 vs_5_0 ps_5_0)"} |
| webRTC | custrom ip address | {address:"127.0.0.1"} |

## `Instance Property`.

| name | explain | type | example |
| :-----------: | :-------------------------------------------------------------------------------------------------------------: | :------: | :-----------------------------------------------------: |
| open | open configuration of fake fingerprint, If no parameter is specified, all configurations are enabled by default | function | instance.open(['navigator','canvas']) |
| close | close configuration of fake fingerprint, If no parameter is specified, all configurations are closed by default | function | instance.close(['navigator','canvas']) |
| set | set configuration of fake fingerprint | function | instance.set({ navigator: { userAgent: 'Custom UA' } }) |
| getKeysStatus | get the currently configured category usage | function | {close:['navigator','canvas'],open:['canvas','webGL']} |

# License

MIT [@hemengke1997](https://github.com/hemengke1997)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"conventional-changelog-cli": "^4.1.0",
"cross-env": "^7.0.3",
"eslint": "8.53.0",
"jsdom": "^23.2.0",
"npm-run-all": "^4.1.5",
"simple-git-hooks": "^2.9.0",
"t2t-tools": "^0.1.1",
Expand Down
Loading

0 comments on commit c3e047a

Please sign in to comment.