clickgo-native 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/index.js +17 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/clickgo-native "Stable Version")
|
|
6
6
|
[](https://www.npmjs.com/package/clickgo-native "Development Version")
|
|
7
|
-
[](https://www.npmjs.com/package/clickgo-native "Beta Version")
|
|
8
7
|
[](https://github.com/maiyun/clickgo-native/blob/master/LICENSE)
|
|
9
8
|
[](https://github.com/maiyun/clickgo-native/issues)
|
|
10
9
|
[](https://github.com/maiyun/clickgo-native/releases "Stable Release")
|
package/dist/index.js
CHANGED
|
@@ -96,7 +96,7 @@ const methods = {
|
|
|
96
96
|
'cg-set-state': {
|
|
97
97
|
'once': false,
|
|
98
98
|
handler: function (t, state) {
|
|
99
|
-
if (!
|
|
99
|
+
if (!form || !state) {
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
if (!verifyToken(t)) {
|
|
@@ -554,16 +554,23 @@ function createForm(p) {
|
|
|
554
554
|
}
|
|
555
555
|
form.show();
|
|
556
556
|
});
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
557
|
+
if (p.startsWith('https://') || p.startsWith('http://')) {
|
|
558
|
+
form.loadURL(p).catch(function (e) {
|
|
559
|
+
throw e;
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
const lio = p.indexOf('?');
|
|
564
|
+
const search = lio === -1 ? '' : p.slice(lio + 1);
|
|
565
|
+
if (lio !== -1) {
|
|
566
|
+
p = p.slice(0, lio);
|
|
567
|
+
}
|
|
568
|
+
form.loadFile(p, {
|
|
569
|
+
'search': search
|
|
570
|
+
}).catch(function (e) {
|
|
571
|
+
throw e;
|
|
572
|
+
});
|
|
561
573
|
}
|
|
562
|
-
form.loadFile(p, {
|
|
563
|
-
'search': search
|
|
564
|
-
}).catch(function (e) {
|
|
565
|
-
throw e;
|
|
566
|
-
});
|
|
567
574
|
form.on('close', function () {
|
|
568
575
|
form = undefined;
|
|
569
576
|
});
|