pake-cli 3.5.3 → 3.6.0
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 +17 -14
- package/dist/cli.js +9 -5
- package/package.json +1 -1
- package/src-tauri/Cargo.lock +52 -30
- package/src-tauri/Cargo.toml +10 -9
- package/src-tauri/gen/schemas/acl-manifests.json +1 -1
- package/src-tauri/gen/schemas/desktop-schema.json +233 -0
- package/src-tauri/gen/schemas/macOS-schema.json +233 -0
- package/src-tauri/src/app/invoke.rs +37 -0
- package/src-tauri/src/app/window.rs +44 -0
- package/src-tauri/src/inject/auth.js +75 -0
- package/src-tauri/src/inject/event.js +8 -1
- package/src-tauri/src/inject/theme_refresh.js +124 -0
- package/src-tauri/src/lib.rs +247 -2
- package/src-tauri/tauri.conf.json +2 -1
|
@@ -260,6 +260,174 @@
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
|
+
{
|
|
264
|
+
"if": {
|
|
265
|
+
"properties": {
|
|
266
|
+
"identifier": {
|
|
267
|
+
"anyOf": [
|
|
268
|
+
{
|
|
269
|
+
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
|
|
270
|
+
"type": "string",
|
|
271
|
+
"const": "opener:default",
|
|
272
|
+
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
|
|
276
|
+
"type": "string",
|
|
277
|
+
"const": "opener:allow-default-urls",
|
|
278
|
+
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"description": "Enables the open_path command without any pre-configured scope.",
|
|
282
|
+
"type": "string",
|
|
283
|
+
"const": "opener:allow-open-path",
|
|
284
|
+
"markdownDescription": "Enables the open_path command without any pre-configured scope."
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"description": "Enables the open_url command without any pre-configured scope.",
|
|
288
|
+
"type": "string",
|
|
289
|
+
"const": "opener:allow-open-url",
|
|
290
|
+
"markdownDescription": "Enables the open_url command without any pre-configured scope."
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
|
|
294
|
+
"type": "string",
|
|
295
|
+
"const": "opener:allow-reveal-item-in-dir",
|
|
296
|
+
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"description": "Denies the open_path command without any pre-configured scope.",
|
|
300
|
+
"type": "string",
|
|
301
|
+
"const": "opener:deny-open-path",
|
|
302
|
+
"markdownDescription": "Denies the open_path command without any pre-configured scope."
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"description": "Denies the open_url command without any pre-configured scope.",
|
|
306
|
+
"type": "string",
|
|
307
|
+
"const": "opener:deny-open-url",
|
|
308
|
+
"markdownDescription": "Denies the open_url command without any pre-configured scope."
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
|
|
312
|
+
"type": "string",
|
|
313
|
+
"const": "opener:deny-reveal-item-in-dir",
|
|
314
|
+
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"then": {
|
|
321
|
+
"properties": {
|
|
322
|
+
"allow": {
|
|
323
|
+
"items": {
|
|
324
|
+
"title": "OpenerScopeEntry",
|
|
325
|
+
"description": "Opener scope entry.",
|
|
326
|
+
"anyOf": [
|
|
327
|
+
{
|
|
328
|
+
"type": "object",
|
|
329
|
+
"required": [
|
|
330
|
+
"url"
|
|
331
|
+
],
|
|
332
|
+
"properties": {
|
|
333
|
+
"app": {
|
|
334
|
+
"description": "An application to open this url with, for example: firefox.",
|
|
335
|
+
"allOf": [
|
|
336
|
+
{
|
|
337
|
+
"$ref": "#/definitions/Application"
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
"url": {
|
|
342
|
+
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
|
|
343
|
+
"type": "string"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"type": "object",
|
|
349
|
+
"required": [
|
|
350
|
+
"path"
|
|
351
|
+
],
|
|
352
|
+
"properties": {
|
|
353
|
+
"app": {
|
|
354
|
+
"description": "An application to open this path with, for example: xdg-open.",
|
|
355
|
+
"allOf": [
|
|
356
|
+
{
|
|
357
|
+
"$ref": "#/definitions/Application"
|
|
358
|
+
}
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
"path": {
|
|
362
|
+
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
|
363
|
+
"type": "string"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"deny": {
|
|
371
|
+
"items": {
|
|
372
|
+
"title": "OpenerScopeEntry",
|
|
373
|
+
"description": "Opener scope entry.",
|
|
374
|
+
"anyOf": [
|
|
375
|
+
{
|
|
376
|
+
"type": "object",
|
|
377
|
+
"required": [
|
|
378
|
+
"url"
|
|
379
|
+
],
|
|
380
|
+
"properties": {
|
|
381
|
+
"app": {
|
|
382
|
+
"description": "An application to open this url with, for example: firefox.",
|
|
383
|
+
"allOf": [
|
|
384
|
+
{
|
|
385
|
+
"$ref": "#/definitions/Application"
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
"url": {
|
|
390
|
+
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
|
|
391
|
+
"type": "string"
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"type": "object",
|
|
397
|
+
"required": [
|
|
398
|
+
"path"
|
|
399
|
+
],
|
|
400
|
+
"properties": {
|
|
401
|
+
"app": {
|
|
402
|
+
"description": "An application to open this path with, for example: xdg-open.",
|
|
403
|
+
"allOf": [
|
|
404
|
+
{
|
|
405
|
+
"$ref": "#/definitions/Application"
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
},
|
|
409
|
+
"path": {
|
|
410
|
+
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
|
411
|
+
"type": "string"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
"properties": {
|
|
421
|
+
"identifier": {
|
|
422
|
+
"description": "Identifier of the permission or permission set.",
|
|
423
|
+
"allOf": [
|
|
424
|
+
{
|
|
425
|
+
"$ref": "#/definitions/Identifier"
|
|
426
|
+
}
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
},
|
|
263
431
|
{
|
|
264
432
|
"if": {
|
|
265
433
|
"properties": {
|
|
@@ -2822,6 +2990,54 @@
|
|
|
2822
2990
|
"const": "oauth:deny-start",
|
|
2823
2991
|
"markdownDescription": "Denies the start command without any pre-configured scope."
|
|
2824
2992
|
},
|
|
2993
|
+
{
|
|
2994
|
+
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
|
|
2995
|
+
"type": "string",
|
|
2996
|
+
"const": "opener:default",
|
|
2997
|
+
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
|
|
3001
|
+
"type": "string",
|
|
3002
|
+
"const": "opener:allow-default-urls",
|
|
3003
|
+
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
|
|
3004
|
+
},
|
|
3005
|
+
{
|
|
3006
|
+
"description": "Enables the open_path command without any pre-configured scope.",
|
|
3007
|
+
"type": "string",
|
|
3008
|
+
"const": "opener:allow-open-path",
|
|
3009
|
+
"markdownDescription": "Enables the open_path command without any pre-configured scope."
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
"description": "Enables the open_url command without any pre-configured scope.",
|
|
3013
|
+
"type": "string",
|
|
3014
|
+
"const": "opener:allow-open-url",
|
|
3015
|
+
"markdownDescription": "Enables the open_url command without any pre-configured scope."
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
|
|
3019
|
+
"type": "string",
|
|
3020
|
+
"const": "opener:allow-reveal-item-in-dir",
|
|
3021
|
+
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
|
|
3022
|
+
},
|
|
3023
|
+
{
|
|
3024
|
+
"description": "Denies the open_path command without any pre-configured scope.",
|
|
3025
|
+
"type": "string",
|
|
3026
|
+
"const": "opener:deny-open-path",
|
|
3027
|
+
"markdownDescription": "Denies the open_path command without any pre-configured scope."
|
|
3028
|
+
},
|
|
3029
|
+
{
|
|
3030
|
+
"description": "Denies the open_url command without any pre-configured scope.",
|
|
3031
|
+
"type": "string",
|
|
3032
|
+
"const": "opener:deny-open-url",
|
|
3033
|
+
"markdownDescription": "Denies the open_url command without any pre-configured scope."
|
|
3034
|
+
},
|
|
3035
|
+
{
|
|
3036
|
+
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
|
|
3037
|
+
"type": "string",
|
|
3038
|
+
"const": "opener:deny-reveal-item-in-dir",
|
|
3039
|
+
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
|
|
3040
|
+
},
|
|
2825
3041
|
{
|
|
2826
3042
|
"description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`",
|
|
2827
3043
|
"type": "string",
|
|
@@ -3026,6 +3242,23 @@
|
|
|
3026
3242
|
}
|
|
3027
3243
|
]
|
|
3028
3244
|
},
|
|
3245
|
+
"Application": {
|
|
3246
|
+
"description": "Opener scope application.",
|
|
3247
|
+
"anyOf": [
|
|
3248
|
+
{
|
|
3249
|
+
"description": "Open in default application.",
|
|
3250
|
+
"type": "null"
|
|
3251
|
+
},
|
|
3252
|
+
{
|
|
3253
|
+
"description": "If true, allow open with any application.",
|
|
3254
|
+
"type": "boolean"
|
|
3255
|
+
},
|
|
3256
|
+
{
|
|
3257
|
+
"description": "Allow specific application to open with.",
|
|
3258
|
+
"type": "string"
|
|
3259
|
+
}
|
|
3260
|
+
]
|
|
3261
|
+
},
|
|
3029
3262
|
"ShellScopeEntryAllowedArg": {
|
|
3030
3263
|
"description": "A command argument allowed to be executed by the webview API.",
|
|
3031
3264
|
"anyOf": [
|
|
@@ -260,6 +260,174 @@
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
|
+
{
|
|
264
|
+
"if": {
|
|
265
|
+
"properties": {
|
|
266
|
+
"identifier": {
|
|
267
|
+
"anyOf": [
|
|
268
|
+
{
|
|
269
|
+
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
|
|
270
|
+
"type": "string",
|
|
271
|
+
"const": "opener:default",
|
|
272
|
+
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
|
|
276
|
+
"type": "string",
|
|
277
|
+
"const": "opener:allow-default-urls",
|
|
278
|
+
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"description": "Enables the open_path command without any pre-configured scope.",
|
|
282
|
+
"type": "string",
|
|
283
|
+
"const": "opener:allow-open-path",
|
|
284
|
+
"markdownDescription": "Enables the open_path command without any pre-configured scope."
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"description": "Enables the open_url command without any pre-configured scope.",
|
|
288
|
+
"type": "string",
|
|
289
|
+
"const": "opener:allow-open-url",
|
|
290
|
+
"markdownDescription": "Enables the open_url command without any pre-configured scope."
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
|
|
294
|
+
"type": "string",
|
|
295
|
+
"const": "opener:allow-reveal-item-in-dir",
|
|
296
|
+
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"description": "Denies the open_path command without any pre-configured scope.",
|
|
300
|
+
"type": "string",
|
|
301
|
+
"const": "opener:deny-open-path",
|
|
302
|
+
"markdownDescription": "Denies the open_path command without any pre-configured scope."
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"description": "Denies the open_url command without any pre-configured scope.",
|
|
306
|
+
"type": "string",
|
|
307
|
+
"const": "opener:deny-open-url",
|
|
308
|
+
"markdownDescription": "Denies the open_url command without any pre-configured scope."
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
|
|
312
|
+
"type": "string",
|
|
313
|
+
"const": "opener:deny-reveal-item-in-dir",
|
|
314
|
+
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"then": {
|
|
321
|
+
"properties": {
|
|
322
|
+
"allow": {
|
|
323
|
+
"items": {
|
|
324
|
+
"title": "OpenerScopeEntry",
|
|
325
|
+
"description": "Opener scope entry.",
|
|
326
|
+
"anyOf": [
|
|
327
|
+
{
|
|
328
|
+
"type": "object",
|
|
329
|
+
"required": [
|
|
330
|
+
"url"
|
|
331
|
+
],
|
|
332
|
+
"properties": {
|
|
333
|
+
"app": {
|
|
334
|
+
"description": "An application to open this url with, for example: firefox.",
|
|
335
|
+
"allOf": [
|
|
336
|
+
{
|
|
337
|
+
"$ref": "#/definitions/Application"
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
"url": {
|
|
342
|
+
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
|
|
343
|
+
"type": "string"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"type": "object",
|
|
349
|
+
"required": [
|
|
350
|
+
"path"
|
|
351
|
+
],
|
|
352
|
+
"properties": {
|
|
353
|
+
"app": {
|
|
354
|
+
"description": "An application to open this path with, for example: xdg-open.",
|
|
355
|
+
"allOf": [
|
|
356
|
+
{
|
|
357
|
+
"$ref": "#/definitions/Application"
|
|
358
|
+
}
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
"path": {
|
|
362
|
+
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
|
363
|
+
"type": "string"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"deny": {
|
|
371
|
+
"items": {
|
|
372
|
+
"title": "OpenerScopeEntry",
|
|
373
|
+
"description": "Opener scope entry.",
|
|
374
|
+
"anyOf": [
|
|
375
|
+
{
|
|
376
|
+
"type": "object",
|
|
377
|
+
"required": [
|
|
378
|
+
"url"
|
|
379
|
+
],
|
|
380
|
+
"properties": {
|
|
381
|
+
"app": {
|
|
382
|
+
"description": "An application to open this url with, for example: firefox.",
|
|
383
|
+
"allOf": [
|
|
384
|
+
{
|
|
385
|
+
"$ref": "#/definitions/Application"
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
"url": {
|
|
390
|
+
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
|
|
391
|
+
"type": "string"
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"type": "object",
|
|
397
|
+
"required": [
|
|
398
|
+
"path"
|
|
399
|
+
],
|
|
400
|
+
"properties": {
|
|
401
|
+
"app": {
|
|
402
|
+
"description": "An application to open this path with, for example: xdg-open.",
|
|
403
|
+
"allOf": [
|
|
404
|
+
{
|
|
405
|
+
"$ref": "#/definitions/Application"
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
},
|
|
409
|
+
"path": {
|
|
410
|
+
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
|
411
|
+
"type": "string"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
"properties": {
|
|
421
|
+
"identifier": {
|
|
422
|
+
"description": "Identifier of the permission or permission set.",
|
|
423
|
+
"allOf": [
|
|
424
|
+
{
|
|
425
|
+
"$ref": "#/definitions/Identifier"
|
|
426
|
+
}
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
},
|
|
263
431
|
{
|
|
264
432
|
"if": {
|
|
265
433
|
"properties": {
|
|
@@ -2822,6 +2990,54 @@
|
|
|
2822
2990
|
"const": "oauth:deny-start",
|
|
2823
2991
|
"markdownDescription": "Denies the start command without any pre-configured scope."
|
|
2824
2992
|
},
|
|
2993
|
+
{
|
|
2994
|
+
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
|
|
2995
|
+
"type": "string",
|
|
2996
|
+
"const": "opener:default",
|
|
2997
|
+
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
|
|
3001
|
+
"type": "string",
|
|
3002
|
+
"const": "opener:allow-default-urls",
|
|
3003
|
+
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
|
|
3004
|
+
},
|
|
3005
|
+
{
|
|
3006
|
+
"description": "Enables the open_path command without any pre-configured scope.",
|
|
3007
|
+
"type": "string",
|
|
3008
|
+
"const": "opener:allow-open-path",
|
|
3009
|
+
"markdownDescription": "Enables the open_path command without any pre-configured scope."
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
"description": "Enables the open_url command without any pre-configured scope.",
|
|
3013
|
+
"type": "string",
|
|
3014
|
+
"const": "opener:allow-open-url",
|
|
3015
|
+
"markdownDescription": "Enables the open_url command without any pre-configured scope."
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
|
|
3019
|
+
"type": "string",
|
|
3020
|
+
"const": "opener:allow-reveal-item-in-dir",
|
|
3021
|
+
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
|
|
3022
|
+
},
|
|
3023
|
+
{
|
|
3024
|
+
"description": "Denies the open_path command without any pre-configured scope.",
|
|
3025
|
+
"type": "string",
|
|
3026
|
+
"const": "opener:deny-open-path",
|
|
3027
|
+
"markdownDescription": "Denies the open_path command without any pre-configured scope."
|
|
3028
|
+
},
|
|
3029
|
+
{
|
|
3030
|
+
"description": "Denies the open_url command without any pre-configured scope.",
|
|
3031
|
+
"type": "string",
|
|
3032
|
+
"const": "opener:deny-open-url",
|
|
3033
|
+
"markdownDescription": "Denies the open_url command without any pre-configured scope."
|
|
3034
|
+
},
|
|
3035
|
+
{
|
|
3036
|
+
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
|
|
3037
|
+
"type": "string",
|
|
3038
|
+
"const": "opener:deny-reveal-item-in-dir",
|
|
3039
|
+
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
|
|
3040
|
+
},
|
|
2825
3041
|
{
|
|
2826
3042
|
"description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`",
|
|
2827
3043
|
"type": "string",
|
|
@@ -3026,6 +3242,23 @@
|
|
|
3026
3242
|
}
|
|
3027
3243
|
]
|
|
3028
3244
|
},
|
|
3245
|
+
"Application": {
|
|
3246
|
+
"description": "Opener scope application.",
|
|
3247
|
+
"anyOf": [
|
|
3248
|
+
{
|
|
3249
|
+
"description": "Open in default application.",
|
|
3250
|
+
"type": "null"
|
|
3251
|
+
},
|
|
3252
|
+
{
|
|
3253
|
+
"description": "If true, allow open with any application.",
|
|
3254
|
+
"type": "boolean"
|
|
3255
|
+
},
|
|
3256
|
+
{
|
|
3257
|
+
"description": "Allow specific application to open with.",
|
|
3258
|
+
"type": "string"
|
|
3259
|
+
}
|
|
3260
|
+
]
|
|
3261
|
+
},
|
|
3029
3262
|
"ShellScopeEntryAllowedArg": {
|
|
3030
3263
|
"description": "A command argument allowed to be executed by the webview API.",
|
|
3031
3264
|
"anyOf": [
|
|
@@ -6,6 +6,9 @@ use tauri::http::Method;
|
|
|
6
6
|
use tauri::{command, AppHandle, Manager, Url, WebviewWindow};
|
|
7
7
|
use tauri_plugin_http::reqwest::{ClientBuilder, Request};
|
|
8
8
|
|
|
9
|
+
#[cfg(target_os = "macos")]
|
|
10
|
+
use tauri::Theme;
|
|
11
|
+
|
|
9
12
|
#[derive(serde::Deserialize)]
|
|
10
13
|
pub struct DownloadFileParams {
|
|
11
14
|
url: String,
|
|
@@ -111,3 +114,37 @@ pub fn send_notification(app: AppHandle, params: NotificationParams) -> Result<(
|
|
|
111
114
|
.unwrap();
|
|
112
115
|
Ok(())
|
|
113
116
|
}
|
|
117
|
+
|
|
118
|
+
#[command]
|
|
119
|
+
pub async fn update_theme_mode(app: AppHandle, mode: String) {
|
|
120
|
+
let window = app.get_webview_window("pake").unwrap();
|
|
121
|
+
#[cfg(target_os = "macos")]
|
|
122
|
+
{
|
|
123
|
+
let theme = if mode == "dark" {
|
|
124
|
+
Theme::Dark
|
|
125
|
+
} else {
|
|
126
|
+
Theme::Light
|
|
127
|
+
};
|
|
128
|
+
let _ = window.set_theme(Some(theme));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#[command]
|
|
133
|
+
#[allow(unreachable_code)]
|
|
134
|
+
pub fn clear_cache_and_restart(app: AppHandle) -> Result<(), String> {
|
|
135
|
+
if let Some(window) = app.get_webview_window("pake") {
|
|
136
|
+
match window.clear_all_browsing_data() {
|
|
137
|
+
Ok(_) => {
|
|
138
|
+
// Clear all browsing data successfully
|
|
139
|
+
app.restart();
|
|
140
|
+
Ok(())
|
|
141
|
+
}
|
|
142
|
+
Err(e) => {
|
|
143
|
+
eprintln!("Failed to clear browsing data: {}", e);
|
|
144
|
+
Err(format!("Failed to clear browsing data: {}", e))
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
Err("Main window not found".to_string())
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -88,6 +88,8 @@ pub fn set_window(app: &mut App, config: &PakeConfig, tauri_config: &Config) ->
|
|
|
88
88
|
.initialization_script(include_str!("../inject/component.js"))
|
|
89
89
|
.initialization_script(include_str!("../inject/event.js"))
|
|
90
90
|
.initialization_script(include_str!("../inject/style.js"))
|
|
91
|
+
.initialization_script(include_str!("../inject/theme_refresh.js"))
|
|
92
|
+
.initialization_script(include_str!("../inject/auth.js"))
|
|
91
93
|
.initialization_script(include_str!("../inject/custom.js"));
|
|
92
94
|
|
|
93
95
|
#[cfg(target_os = "windows")]
|
|
@@ -193,5 +195,47 @@ pub fn set_window(app: &mut App, config: &PakeConfig, tauri_config: &Config) ->
|
|
|
193
195
|
println!("Proxy configured: {}", config.proxy_url);
|
|
194
196
|
}
|
|
195
197
|
|
|
198
|
+
// Allow navigation to OAuth/authentication domains
|
|
199
|
+
window_builder = window_builder.on_navigation(|url| {
|
|
200
|
+
let url_str = url.as_str();
|
|
201
|
+
|
|
202
|
+
// Always allow same-origin navigation
|
|
203
|
+
if url_str.starts_with("http://localhost") || url_str.starts_with("http://127.0.0.1") {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Check for OAuth/authentication domains
|
|
208
|
+
let auth_patterns = [
|
|
209
|
+
"accounts.google.com",
|
|
210
|
+
"login.microsoftonline.com",
|
|
211
|
+
"github.com/login",
|
|
212
|
+
"appleid.apple.com",
|
|
213
|
+
"facebook.com",
|
|
214
|
+
"twitter.com",
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
let auth_paths = ["/oauth/", "/auth/", "/authorize", "/login"];
|
|
218
|
+
|
|
219
|
+
// Allow if matches auth patterns
|
|
220
|
+
for pattern in &auth_patterns {
|
|
221
|
+
if url_str.contains(pattern) {
|
|
222
|
+
#[cfg(debug_assertions)]
|
|
223
|
+
println!("Allowing OAuth navigation to: {}", url_str);
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
for path in &auth_paths {
|
|
229
|
+
if url_str.contains(path) {
|
|
230
|
+
#[cfg(debug_assertions)]
|
|
231
|
+
println!("Allowing auth path navigation to: {}", url_str);
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Allow all other navigation by default
|
|
237
|
+
true
|
|
238
|
+
});
|
|
239
|
+
|
|
196
240
|
window_builder.build().expect("Failed to build window")
|
|
197
241
|
}
|