mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-10-19 22:17:28 +02:00
chore: linting
This commit is contained in:
1 parent
eb0de8eb22
commit
cc52984312
4 files changed
+98
-50
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { mkdir, writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import en from "../../src/i18n/locales/en.json" with { type: "json" };
|
||||
import { WebDriverClient } from "./webdriver.mjs";
|
||||
|
||||
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
@@ -300,9 +301,53 @@ export class AppSession {
|
||||
timeoutMs: 60_000,
|
||||
},
|
||||
);
|
||||
await this.dismissStartupPermissions();
|
||||
return this;
|
||||
}
|
||||
|
||||
async dismissStartupPermissions() {
|
||||
if (
|
||||
process.platform !== "darwin" ||
|
||||
!(await this.invoke("get_onboarding_completed"))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const [microphone, camera] = await Promise.all([
|
||||
this.invoke("plugin:macos-permissions|check_microphone_permission"),
|
||||
this.invoke("plugin:macos-permissions|check_camera_permission"),
|
||||
]);
|
||||
if (microphone && camera) return;
|
||||
|
||||
const title = microphone
|
||||
? en.permissionDialog.titleCamera
|
||||
: en.permissionDialog.titleMicrophone;
|
||||
await this.clickElement(
|
||||
() =>
|
||||
this.execute(
|
||||
`
|
||||
const dialog = [...document.querySelectorAll("[role='dialog']")].find(
|
||||
(node) => node.querySelector("h2")?.textContent === arguments[0]
|
||||
);
|
||||
return [...(dialog?.querySelectorAll("button") ?? [])].find(
|
||||
(button) => button.textContent.trim() === arguments[1]
|
||||
) ?? null;
|
||||
`,
|
||||
[title, en.permissionDialog.cancelButton],
|
||||
),
|
||||
"startup permission dialog Cancel button",
|
||||
);
|
||||
await this.waitFor(
|
||||
() =>
|
||||
this.execute(
|
||||
`return ![...document.querySelectorAll("[role='dialog']")].some(
|
||||
(node) => node.querySelector("h2")?.textContent === arguments[0]
|
||||
);`,
|
||||
[title],
|
||||
),
|
||||
{ description: "startup permission dialog to close" },
|
||||
);
|
||||
}
|
||||
|
||||
async restart() {
|
||||
await this.close();
|
||||
return this.start();
|
||||
|
||||
+7
-7
@@ -74,13 +74,13 @@
|
||||
"@tanstack/react-table": "^9.2.4",
|
||||
"@tanstack/react-virtual": "^3.14.13",
|
||||
"@tanstack/table-core": "9.2.4",
|
||||
"@tauri-apps/api": "~2.12.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.4.0",
|
||||
"@tauri-apps/plugin-deep-link": "^2.6.0",
|
||||
"@tauri-apps/plugin-dialog": "^2.8.0",
|
||||
"@tauri-apps/plugin-fs": "~2.6.0",
|
||||
"@tauri-apps/plugin-log": "^2.10.0",
|
||||
"@tauri-apps/plugin-opener": "^2.7.0",
|
||||
"@tauri-apps/api": "~2.11.1",
|
||||
"@tauri-apps/plugin-clipboard-manager": "~2.3.3",
|
||||
"@tauri-apps/plugin-deep-link": "~2.4.10",
|
||||
"@tauri-apps/plugin-dialog": "~2.7.3",
|
||||
"@tauri-apps/plugin-fs": "~2.5.2",
|
||||
"@tauri-apps/plugin-log": "~2.9.2",
|
||||
"@tauri-apps/plugin-opener": "~2.5.5",
|
||||
"ahooks": "^3.10.0",
|
||||
"aria-hidden": "1.2.6",
|
||||
"canvas-confetti": "^1.9.4",
|
||||
|
||||
Generated
+43
-42
@@ -163,6 +163,7 @@ settings:
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
overrides:
|
||||
'@tauri-apps/api': ~2.11.1
|
||||
picomatch@>=4.0.0 <4.0.4: '>=4.0.4'
|
||||
path-to-regexp@>=8.0.0 <8.4.0: '>=8.4.0'
|
||||
postcss@<8.5.18: '>=8.5.18'
|
||||
@@ -238,26 +239,26 @@ importers:
|
||||
specifier: 9.2.4
|
||||
version: 9.2.4
|
||||
'@tauri-apps/api':
|
||||
specifier: ~2.12.0
|
||||
version: 2.12.0
|
||||
specifier: ~2.11.1
|
||||
version: 2.11.1
|
||||
'@tauri-apps/plugin-clipboard-manager':
|
||||
specifier: ^2.4.0
|
||||
version: 2.4.0
|
||||
specifier: ~2.3.3
|
||||
version: 2.3.3
|
||||
'@tauri-apps/plugin-deep-link':
|
||||
specifier: ^2.6.0
|
||||
version: 2.6.0
|
||||
specifier: ~2.4.10
|
||||
version: 2.4.10
|
||||
'@tauri-apps/plugin-dialog':
|
||||
specifier: ^2.8.0
|
||||
version: 2.8.0
|
||||
specifier: ~2.7.3
|
||||
version: 2.7.3
|
||||
'@tauri-apps/plugin-fs':
|
||||
specifier: ~2.6.0
|
||||
version: 2.6.0
|
||||
specifier: ~2.5.2
|
||||
version: 2.5.2
|
||||
'@tauri-apps/plugin-log':
|
||||
specifier: ^2.10.0
|
||||
version: 2.10.0
|
||||
specifier: ~2.9.2
|
||||
version: 2.9.2
|
||||
'@tauri-apps/plugin-opener':
|
||||
specifier: ^2.7.0
|
||||
version: 2.7.0
|
||||
specifier: ~2.5.5
|
||||
version: 2.5.5
|
||||
ahooks:
|
||||
specifier: ^3.10.0
|
||||
version: 3.10.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
|
||||
@@ -2416,8 +2417,8 @@ packages:
|
||||
'@tanstack/virtual-core@3.17.11':
|
||||
resolution: {integrity: sha512-+ILjvtHup6Y2hzQ6YzwMgX1Q+oQpxEGOXCEsCNaPoIP0VxMbizIBTmYTDtkerkIQS8/CbP1BRuyt8V/8BCsy1g==}
|
||||
|
||||
'@tauri-apps/api@2.12.0':
|
||||
resolution: {integrity: sha512-fUSxFX8VABYe9W9K5ROdEaKVkNUFRcMSRofjruvaxztXA+I0XnQHcYHF8m/a6iExRUxsUf0HsFWhPBuH9IgzJw==}
|
||||
'@tauri-apps/api@2.11.1':
|
||||
resolution: {integrity: sha512-M2FPuYND2m+wh5hfW9ZpSdxMPdEJovPBWwoHJmwUpysTYNHaOkVFN419m/K0LIgjb/7KU2vBgsUepJWugQCvAA==}
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@2.12.0':
|
||||
resolution: {integrity: sha512-v5J+jISihLGtih1+3yWagbsL+5dbLZORu4vaSI0vhY0Heb+MAW+T/1s1RyKxrQrwEPGBG5kqwfDDTnSbmVkuqA==}
|
||||
@@ -2495,23 +2496,23 @@ packages:
|
||||
engines: {node: '>= 10'}
|
||||
hasBin: true
|
||||
|
||||
'@tauri-apps/plugin-clipboard-manager@2.4.0':
|
||||
resolution: {integrity: sha512-yAuTffXc/sm+4oYnrwxbUkaJXQMTesPJ9dim0ADcA31rpboyhAN2TGQqs9VCcPIpb60LFOeePkvhpP2I3xhejg==}
|
||||
'@tauri-apps/plugin-clipboard-manager@2.3.3':
|
||||
resolution: {integrity: sha512-KnyoTs9gj1yEgDkSPUNjOIOHjJTr5wk8IWcYMOWxYTIJCip6QwlyPW8u2X+6bd6kHM4fAdZNpxoal0gy/TwJbg==}
|
||||
|
||||
'@tauri-apps/plugin-deep-link@2.6.0':
|
||||
resolution: {integrity: sha512-41rOuYUZjxcEz71qLh1k9m7M2W6gQdWfvyYHuoKRTv1NMYQURTw+v2eItCa/efk+5PlEjtkjtTsoJQ2R9U5MCA==}
|
||||
'@tauri-apps/plugin-deep-link@2.4.10':
|
||||
resolution: {integrity: sha512-SuXI47ORUzYuwG6c8dluLDrStTvli5bAZDRa2+VuUEzK/9TEa7FZz7UKXBQriL7+CPFXRHQsz5tSocc47tRXQQ==}
|
||||
|
||||
'@tauri-apps/plugin-dialog@2.8.0':
|
||||
resolution: {integrity: sha512-HSSD5C8UFE9ijD1wue84F7jjaIReFmj8AAPtS+xyjYRltJafIc4BiWHY7SJ6vbbew6u+YljEJHfyNfy5VwywXg==}
|
||||
'@tauri-apps/plugin-dialog@2.7.3':
|
||||
resolution: {integrity: sha512-CRgE+7TP4tvq9MjBU6f04NLTFIqVMLKHk3hAqlhil00ngK9ACTrXPH3oHpKMProxILodd3YjBoKbMwSI4IEcfA==}
|
||||
|
||||
'@tauri-apps/plugin-fs@2.6.0':
|
||||
resolution: {integrity: sha512-MhBAZ4rryd+h9fijd/GWDfArqiAeGI0ZNduV4wuRyUVI6wDZ+oDBY7atqtoXKDwlTUVSvpvmWJAY0ehQd/v6Uw==}
|
||||
'@tauri-apps/plugin-fs@2.5.2':
|
||||
resolution: {integrity: sha512-XXvMSnFiob+G1H+YHCDf+bzWVumseQuEIhzpbOJzevUfL4k0U+sTApZWJHpoLiamggnVPJm5dJ5sDsniRyWxlg==}
|
||||
|
||||
'@tauri-apps/plugin-log@2.10.0':
|
||||
resolution: {integrity: sha512-IHMspJx/fDA+8q8O6MTbrKffkemSDa1I5iXRhnLrLVnOd7xK4bAosyQbWcjnpPA7E+c6BMkpsE2kESHhkiBrDg==}
|
||||
'@tauri-apps/plugin-log@2.9.2':
|
||||
resolution: {integrity: sha512-QC2uTQyC+4269xawGXzVLDzIvMB2JwzZHd1lg3ltXtXqrauwikqlbNt6Tm3H++1RN0gPtcvp4cBc5bF6u/DUnw==}
|
||||
|
||||
'@tauri-apps/plugin-opener@2.7.0':
|
||||
resolution: {integrity: sha512-mBorYfVKh9Lt7s4ZFtKbMUTxBw+Y/sVmSlKCtkkoBgMTC/DIbt/kaPm67L/2djAUqDI1wbixy5OHHVmipjuGMw==}
|
||||
'@tauri-apps/plugin-opener@2.5.5':
|
||||
resolution: {integrity: sha512-xvzGai5aQds8j8R8RsUK/lW6pGG50YgOYIPLzvkqmkwAj7dfySOD7sGtejRzvVdMmv1EQfKVEFh1MvmDp8QR0g==}
|
||||
|
||||
'@tokenizer/inflate@0.4.1':
|
||||
resolution: {integrity: sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==}
|
||||
@@ -7401,7 +7402,7 @@ snapshots:
|
||||
|
||||
'@tanstack/virtual-core@3.17.11': {}
|
||||
|
||||
'@tauri-apps/api@2.12.0': {}
|
||||
'@tauri-apps/api@2.11.1': {}
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@2.12.0':
|
||||
optional: true
|
||||
@@ -7450,29 +7451,29 @@ snapshots:
|
||||
'@tauri-apps/cli-win32-ia32-msvc': 2.12.0
|
||||
'@tauri-apps/cli-win32-x64-msvc': 2.12.0
|
||||
|
||||
'@tauri-apps/plugin-clipboard-manager@2.4.0':
|
||||
'@tauri-apps/plugin-clipboard-manager@2.3.3':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.12.0
|
||||
'@tauri-apps/api': 2.11.1
|
||||
|
||||
'@tauri-apps/plugin-deep-link@2.6.0':
|
||||
'@tauri-apps/plugin-deep-link@2.4.10':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.12.0
|
||||
'@tauri-apps/api': 2.11.1
|
||||
|
||||
'@tauri-apps/plugin-dialog@2.8.0':
|
||||
'@tauri-apps/plugin-dialog@2.7.3':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.12.0
|
||||
'@tauri-apps/api': 2.11.1
|
||||
|
||||
'@tauri-apps/plugin-fs@2.6.0':
|
||||
'@tauri-apps/plugin-fs@2.5.2':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.12.0
|
||||
'@tauri-apps/api': 2.11.1
|
||||
|
||||
'@tauri-apps/plugin-log@2.10.0':
|
||||
'@tauri-apps/plugin-log@2.9.2':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.12.0
|
||||
'@tauri-apps/api': 2.11.1
|
||||
|
||||
'@tauri-apps/plugin-opener@2.7.0':
|
||||
'@tauri-apps/plugin-opener@2.5.5':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.12.0
|
||||
'@tauri-apps/api': 2.11.1
|
||||
|
||||
'@tokenizer/inflate@0.4.1(supports-color@8.1.1)':
|
||||
dependencies:
|
||||
@@ -10004,7 +10005,7 @@ snapshots:
|
||||
|
||||
tauri-plugin-macos-permissions-api@2.3.0:
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.12.0
|
||||
'@tauri-apps/api': 2.11.1
|
||||
|
||||
terser@5.51.2:
|
||||
dependencies:
|
||||
|
||||
+3
-1
@@ -11,9 +11,11 @@ onlyBuiltDependencies:
|
||||
- sqlite3
|
||||
- unrs-resolver
|
||||
|
||||
# Pinned for security. Moved from package.json#pnpm.overrides — pnpm 11
|
||||
# Dependency pins. Moved from package.json#pnpm.overrides — pnpm 11
|
||||
# no longer reads that field; settings live here now.
|
||||
overrides:
|
||||
# Keep the API used by plugins on the Rust crate's minor version.
|
||||
'@tauri-apps/api': '~2.11.1'
|
||||
picomatch@>=4.0.0 <4.0.4: '>=4.0.4'
|
||||
path-to-regexp@>=8.0.0 <8.4.0: '>=8.4.0'
|
||||
postcss@<8.5.18: '>=8.5.18'
|
||||
|
||||
Reference in new issue
Block a user