chore: allowlist

This commit is contained in:
lencx
2023-03-01 19:21:59 +08:00
parent 0c0197f0b4
commit 71b257c0cf
8 changed files with 148 additions and 177 deletions

View File

@@ -26,8 +26,8 @@ wry = "0.24.1"
dark-light = "1.0.0"
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.23.0", features = ["macros"] }
tauri = { version = "1.2.4", features = ["api-all", "devtools", "global-shortcut", "system-tray", "updater"] }
tauri-plugin-positioner = { version = "1.0.4", features = ["system-tray"] }
tauri = { version = "1.2.4", features = ["devtools", "fs-create-dir", "fs-exists", "fs-read-dir", "fs-read-file", "fs-remove-dir", "fs-remove-file", "fs-write-file", "global-shortcut", "global-shortcut-all", "os-all", "path-all", "process-all", "shell-open-api", "system-tray", "updater"] }
tauri-plugin-positioner = { git = "https://github.com/lencx/tauri-plugins-workspace", features = ["system-tray"] }
tauri-plugin-log = { git = "https://github.com/lencx/tauri-plugins-workspace", branch = "dev", features = ["colored"] }
tauri-plugin-autostart = { git = "https://github.com/lencx/tauri-plugins-workspace", branch = "dev" }
tauri-plugin-window-state = { git = "https://github.com/lencx/tauri-plugins-workspace", branch = "dev" }

View File

@@ -166,6 +166,7 @@ async function cmdTip() {
// Enter a command starting with `/` and press a space to automatically fill `chatgpt prompt`.
// If more than one command appears in the search results, the first one will be used by default.
function cmdKeydown(event) {
if (!window.__CHAT_MODEL_CMD_PROMPT__) {
return;
}
@@ -245,8 +246,14 @@ async function cmdTip() {
searchInput.value = window.__CHAT_MODEL_CMD_PROMPT__;
initDom();
event.preventDefault();
}
if (event.keyCode === 13 && __TAURI_METADATA__.__currentWindow.label === 'tray') {
const btn = document.querySelector('form button');
if (btn) btn.click();
}
}
searchInput.removeEventListener('keydown', cmdKeydown, { capture: true });
searchInput.addEventListener('keydown', cmdKeydown, { capture: true });

View File

@@ -1,6 +1,7 @@
// *** Core Script - Export ***
async function init() {
if (window.location.pathname === '/auth/login') return;
const buttonOuterHTMLFallback = `<button class="btn flex justify-center gap-2 btn-neutral" id="download-png-button">Try Again</button>`;
removeButtons();
if (window.buttonsInterval) {

View File

@@ -7,19 +7,38 @@
},
"package": {
"productName": "ChatGPT",
"version": "0.11.0"
"version": "0.11.99"
},
"tauri": {
"allowlist": {
"all": true,
"all": false,
"globalShortcut": {
"all": true
},
"fs": {
"all": true,
"all": false,
"readFile": true,
"writeFile": true,
"readDir": true,
"createDir": true,
"exists": true,
"removeFile": true,
"removeDir": true,
"scope": [
"$HOME/.chatgpt/**"
]
},
"path": {
"all": true
},
"os": {
"all": true
},
"process": {
"all": true,
"exit": true,
"relaunch": true,
"relaunchDangerousAllowSymlinkMacos": true
}
},
"systemTray": {