clickgo-native 0.0.4-dev4 → 0.0.6-dev6

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/dist/index.js CHANGED
@@ -436,16 +436,23 @@ function createForm(p) {
436
436
  }
437
437
  form.show();
438
438
  });
439
- const lio = p.indexOf('?');
440
- const search = lio === -1 ? '' : p.slice(lio + 1);
441
- if (lio !== -1) {
442
- p = p.slice(0, lio);
439
+ if (p.startsWith('https://')) {
440
+ form.loadURL(p).catch(function (e) {
441
+ throw e;
442
+ });
443
+ }
444
+ else {
445
+ const lio = p.indexOf('?');
446
+ const search = lio === -1 ? '' : p.slice(lio + 1);
447
+ if (lio !== -1) {
448
+ p = p.slice(0, lio);
449
+ }
450
+ form.loadFile(p, {
451
+ 'search': search
452
+ }).catch(function (e) {
453
+ throw e;
454
+ });
443
455
  }
444
- form.loadFile(p, {
445
- 'search': search
446
- }).catch(function (e) {
447
- throw e;
448
- });
449
456
  form.on('close', function () {
450
457
  form = undefined;
451
458
  });
package/dist/index.ts CHANGED
@@ -504,16 +504,25 @@ function createForm(p: string): void {
504
504
  }
505
505
  form.show();
506
506
  });
507
- const lio = p.indexOf('?');
508
- const search = lio === -1 ? '' : p.slice(lio + 1);
509
- if (lio !== -1) {
510
- p = p.slice(0, lio);
507
+ if (p.startsWith('https://') || p.startsWith('http://')) {
508
+ // --- 加载网页 ---
509
+ form.loadURL(p).catch(function(e): void {
510
+ throw e;
511
+ });
512
+ }
513
+ else {
514
+ // --- 加载本地文件 ---
515
+ const lio = p.indexOf('?');
516
+ const search = lio === -1 ? '' : p.slice(lio + 1);
517
+ if (lio !== -1) {
518
+ p = p.slice(0, lio);
519
+ }
520
+ form.loadFile(p, {
521
+ 'search': search
522
+ }).catch(function(e): void {
523
+ throw e;
524
+ });
511
525
  }
512
- form.loadFile(p, {
513
- 'search': search
514
- }).catch(function(e): void {
515
- throw e;
516
- });
517
526
  form.on('close', function() {
518
527
  form = undefined;
519
528
  });
@@ -0,0 +1,22 @@
1
+ // eslint.config.js
2
+ const rules = require('@litert/eslint-plugin-recommended-rules');
3
+
4
+ module.exports = [
5
+ ...rules.typescript,
6
+ {
7
+ files: [
8
+ '**/*.ts', // don't add `./` before the path
9
+ ],
10
+ languageOptions: {
11
+ parserOptions: {
12
+ project: 'tsconfig.json',
13
+ tsconfigRootDir: __dirname,
14
+ },
15
+ },
16
+ rules: {
17
+ '@typescript-eslint/no-explicit-any': 'off',
18
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
19
+ 'max-lines': ['warn', 5000]
20
+ }
21
+ }
22
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo-native",
3
- "version": "0.0.4-dev4",
3
+ "version": "0.0.6-dev6",
4
4
  "description": "The software developed with ClickGo will run in Windows, Mac OS, Linux.",
5
5
  "keywords": [
6
6
  "clickgo",
@@ -14,14 +14,14 @@
14
14
  "native": "electron ./dist/test"
15
15
  },
16
16
  "devDependencies": {
17
- "@litert/eslint-plugin-rules": "^0.1.2",
18
- "@litert/loader": "^3.4.6",
19
- "@types/jszip": "^3.4.1",
20
- "@types/node": "^18.11.14",
21
- "clickgo": "^3.1.6-dev15",
22
- "typescript": "^4.9.4"
17
+ "@litert/eslint-plugin-rules": "^0.3.1",
18
+ "@litert/loader": "^3.5.9",
19
+ "@types/node": "^24.0.3",
20
+ "clickgo": "^3.16.16",
21
+ "jszip": "^3.10.1",
22
+ "typescript": "^5.8.3"
23
23
  },
24
24
  "dependencies": {
25
- "electron": "^22.0.2"
25
+ "electron": "^36.4.0"
26
26
  }
27
27
  }