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

Support open devtools on app had been builded #1523

Closed
askie opened this issue Jul 3, 2022 · 15 comments · Fixed by #2725
Closed

Support open devtools on app had been builded #1523

askie opened this issue Jul 3, 2022 · 15 comments · Fixed by #2725
Labels
awaiting feedback More information is required from the requestor

Comments

@askie
Copy link

askie commented Jul 3, 2022

Is your feature request related to a problem? Please describe.

when app have been builded , open the app,sometimes need to open devtools to debug error.

Describe the solution you'd like

need a method to open devtools

Describe alternatives you've considered

No response

Additional context

No response

@leaanthony
Copy link
Member

Compile with wails build -debug 👍

@leaanthony leaanthony added the awaiting feedback More information is required from the requestor label Jul 3, 2022
@askie
Copy link
Author

askie commented Jul 3, 2022

this working, thx

@askie askie closed this as completed Jul 3, 2022
@garfieldbanks
Copy link

garfieldbanks commented Jan 13, 2023

I'm using this on Windows and when I add -debug it allows me to open devtools but it also opens a command window. Is there an option to disable the command window and only allow opening devtools?

@leaanthony
Copy link
Member

No I don't think so

@JSchmidt63
Copy link

Great command! :-)
Is it possible in a production build to toggle: show the devttools debug or no show devtools debug by a command line arguments?

@davidnewhall
Copy link

Is there an option to disable the command window and only allow opening devtools?

I need this too. :( The console window is useless and in the way, but the inspector is crucial for troubleshooting in new apps.

@leaanthony
Copy link
Member

wails build -debug will allow you to right click and open the dev tools for a production build.

@davidnewhall
Copy link

I understand, but it also opens a console window. I want the inspector to be accessible by default, but I do not want a console window.

@mmghv
Copy link
Contributor

mmghv commented Jun 10, 2023

Same here, It would be useful to enable the devtools without the console window, it's not acceptable to publish the application with the console window.

it would be nice to have a separate -devtools flag.

@leaanthony
Copy link
Member

Do you know if that's even possible?

@davidnewhall
Copy link

It should be possible. I don't think the console window and blocking context menus are directly related. Are they?

I'm familiar with the Windows console window. Newer versions of Windows use a "Terminal" window, and it has new problems with Go apps. The age old -H=windowsgui ld flag still seems to be the number one way to prevent a GUI app from having a console (or Terminal) window.

Conversely, I have no idea how you're turning off right click on the Windows. I use javascript if I need that feature.

  /* Prevent right-click when dev mode is disabled. */
  let allow_console_window = false;
  function blockRightClick(e) { if (!allow_console_window) e.preventDefault() }
  document.removeEventListener("contextmenu", blockRightClick)
  document.addEventListener("contextmenu", blockRightClick)

@mmghv
Copy link
Contributor

mmghv commented Jun 12, 2023

I'm working on a PR right now, you'll be able to do wails build -devtools, tested on windows and is working perfectly.

@mmghv
Copy link
Contributor

mmghv commented Jun 12, 2023

PR: #2725, tests needed on Linux and macOS.

@davidnewhall
Copy link

I'll do some testing on macOS; can't do much with Linux though.

@mmghv
Copy link
Contributor

mmghv commented Jun 12, 2023

@davidnewhall That's perfect, please follow the test cases and report your results in the PR thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback More information is required from the requestor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants