Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the webInspector console, I am unable to copy or paste. #148

Open
qq253498229 opened this issue Jan 23, 2025 · 8 comments
Open

In the webInspector console, I am unable to copy or paste. #148

qq253498229 opened this issue Jan 23, 2025 · 8 comments

Comments

@qq253498229
Copy link

I have set "enableInspector": true in the neutralino.config.json file.

However, I found that I cannot use shortcuts like "command+c/v" in the opened webInspector.

I have tested with Tauri, and everything works fine. Both use webInspector.

How can I resolve this issue?

@qq253498229
Copy link
Author

I found that right-clicking to select Copy/Paste works, only the shortcuts are not work.

@CosmoMyzrailGorynych
Copy link
Contributor

@qq253498229 Please tell your OS and version, libwebkit/WebView2 and browser version.

@qq253498229
Copy link
Author

qq253498229 commented Feb 5, 2025

@CosmoMyzrailGorynych

OS: macOS 13.7 (22H123)

I don't know how to check the version of libwebkit/WebView2. Below is the information I got when I tried to access https://www.whatismybrowser.com/detect/what-is-my-user-agent/#google_vignette using Safari.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15

@qq253498229
Copy link
Author

I'm wondering if there's an issue with my configuration, because it seems that my WebKit isn't loading properly.

There's no menu similar to the one that appears at the top after Tauri starts, and it appears that all the shortcuts, including Command+Q, are not working.

my neutralino.config.json:

{
  "applicationId": "wang-neu-client",
  "version": "1.0.0",
  "defaultMode": "window",
  "documentRoot": "/angular-src/dist/ng001/browser/",
  "url": "/",
  "enableServer": true,
  "nativeAllowList": [
    "os.setTray",
    "resources.getFiles",
    "app.exit"
  ],
  "modes": {
    "window": {
      "title": "wang-neu-client",
      "width": 1300,
      "height": 800,
      "center": true,
      "icon": "/angular-src/public/logo.png",
      "enableInspector": false
    }
  },
  "cli": {
    "binaryName": "wang-neu-client",
    "extensionsPath": "/extensions/",
    "resourcesPath": "/angular-src/dist/ng001/browser/",
    "frontendLibrary": {
      "patchFile": "/angular-src/src/index.html",
      "devUrl": "http://localhost:4200",
      "projectPath": "/angular-src/",
      "initCommand": "npm install",
      "devCommand": "npm run start",
      "buildCommand": "npm run build",
      "waitTimeout": 20000
    },
    "binaryVersion": "5.5.0"
  },
  "buildScript": {
    "mac": {
      "architecture": [
        "x64",
        "arm64",
        "universal"
      ],
      "minimumOS": "10.13.0",
      "appName": "wang-neu-client",
      "appBundleName": "wang-neu-client",
      "appIdentifier": "cn.codeforfun.wang-neu-client",
      "appIcon": "/angular-src/public/logo.icns"
    },
    "win": {
      "architecture": [
        "x64"
      ],
      "appName": "wang-neu-client",
      "appIcon": "/angular-src/public/favicon.ico"
    },
    "linux": {
      "architecture": [
        "x64",
        "arm64",
        "armhf"
      ],
      "appName": "wang-neu-client",
      "appIcon": "/angular-src/public/logo.png",
      "appPath": "/usr/share/wang-neu-client",
      "appIconPath": "/usr/share/wang-neu-client/icon.png",
      "appIconLocation": "/usr/share/wang-neu-client/icon.png"
    }
  }
}

@CosmoMyzrailGorynych
Copy link
Contributor

Hmmm, I'm afraid it's Neutralino's or Webview library's bug. There are also issues where regular hotkeys can't be fired on macOS in webviews themselves.

@qq253498229
Copy link
Author

However, Tauri also uses a WebView, and the shortcuts there work perfectly fine without any problems.

@CosmoMyzrailGorynych
Copy link
Contributor

No, Tauri uses its own framework called WRY.

@CosmoMyzrailGorynych
Copy link
Contributor

CosmoMyzrailGorynych commented Feb 6, 2025

Discussed it a bit on Discord and here are the key points:

  • Default hotkeys like cmd+c, cmd+v are actually not that default as they only work if they are defined in an app's menubar. (Yikes!)
  • Neutralino.js doesn't have a menubar atm, thus no default hotkeys. You can, however, listen to such hotkeys in your webpage and run an appropriate document.execCommand call.
  • There are plans to introduce APIs to configure the menubar for GSoC 2025.
  • Shalitha Suranga might add a default macOS-only menubar earlier, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants