Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78de1d5

Browse files
committed
fix: 修复 append 兼容性问题
Close suanmei#119
1 parent 71c7eb3 commit 78de1d5

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

example/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@ function App() {
6363
</button>
6464
<button
6565
onClick={() => {
66-
evoke('zhihu://');
66+
evoke('zhihu://question/270839820');
6767
}}
6868
>
6969
schema - iframe
7070
</button>
7171
<button
7272
onClick={() => {
73-
evokeByLocation('zhihu://');
73+
evokeByLocation('zhihu://question/270839820');
7474
}}
7575
>
7676
schema - location
7777
</button>
7878
<button
7979
onClick={() => {
80-
evokeByTagA('zhihu://');
80+
evokeByTagA('zhihu://question/270839820');
8181
}}
8282
>
8383
schema - A Tag

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "callapp-lib",
3-
"version": "3.5.0",
3+
"version": "3.5.1",
44
"description": "call native webview from webpage",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.esm.js",

src/evoke.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export function evokeByTagA(uri: string): void {
4747

4848
tagA.setAttribute('href', uri);
4949
tagA.style.display = 'none';
50-
document.body.append(tagA);
50+
// append 在 android 6 系统中有兼容性问题
51+
// eslint-disable-next-line unicorn/prefer-node-append
52+
document.body.appendChild(tagA);
5153

5254
tagA.click();
5355
}

0 commit comments

Comments
 (0)