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

Dev console visible from production app #290

Open
avazquez-bit opened this issue May 2, 2024 · 8 comments
Open

Dev console visible from production app #290

avazquez-bit opened this issue May 2, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@avazquez-bit
Copy link

What were you trying to do?

When app is packed and installed, de program can display dev console

image

What happened?

This console is not supposed to be showed in a production app

How to reproduce the bug

Run de app, in view tab open Developer tools

Package Versions

{"installed":[{"name":"nativephp/electron","direct-dependency":true,"homepage":"https://github.com/nativephp/electron","source":"https://github.com/NativePHP/electron/tree/0.6.1","version":"0.6.1","description":"Electron wrapper for the NativePHP framework.","abandoned":false},{"name":"nativephp/laravel","direct-dependency":false,"homepage":"https://github.com/nativephp/laravel","source":"https://github.com/NativePHP/laravel/tree/0.5.0","version":"0.5.0","description":"Laravel wrapper for the NativePHP framework.","abandoned":false},{"name":"nativephp/php-bin","direct-dependency":false,"homepage":"https://nativephp.com","source":"https://github.com/NativePHP/php-bin/tree/0.4.0","version":"0.4.0","description":"PHP binaries used by the NativePHP framework","abandoned":false}]}

PHP Version

8.2.18

Laravel Version

10.10

Node Version

18.8.0

Which operating systems have you seen this occur on?

Windows

OS version

Win 11 (23H2)

Notes

No response

@avazquez-bit avazquez-bit added the bug Something isn't working label May 2, 2024
@simonhamp simonhamp self-assigned this May 3, 2024
@Fludem
Copy link

Fludem commented May 3, 2024

@simonhamp

Should we disable Chrome Tools in a packaged application? Or is this something that the developer should decide?

A lot of electron applications include this functionality, such as GitHub Desktop.

Sorry if this is covered somewhere and it's a silly question.

@Fludem
Copy link

Fludem commented May 3, 2024

I believe dev tools are enabled by default if your application is in debug mode.

Window.php Line 57

You can change the default behaviour by using the showDevTools method on the Window class and passing it true or false. True to enable them and false to disable them.

Window->showDevTools($bool)

@avazquez-bit Would you mind disabling debug or manually calling this function to disable the dev tools and rebuilding your application to see if they're now disabled?

If they are you should have a workaround for now. Improving how this is handled probably requires some thought and input from others, and it is probably not worth Simon's focus on if there's a workaround.

@simonhamp
Copy link
Member

Should we disable Chrome Tools in a packaged application? Or is this something that the developer should decide?

@Fludem it's a valid question. I like the flexibility of letting the developer decide... I think the fact that it's in the Window class allows for that.

But what we should have is either:

  1. a sensible default (i.e. we intentionally turn APP_DEBUG=false during the build process); or
  2. show a warning that APP_DEBUG=true at build time.

If we do (1), there's no danger of someone accidentally leaving debug mode on, which has wider implications than just allowing the DevTools to show.

If we only do (2), my feeling is there's a chance that folks either miss it (build output is often messy) or become blind to it.

@avazquez-bit
Copy link
Author

@Fludem I'm gonna try, and let you knwo whats happens, i dont see those specifications you mention.

Thanks for the tip

@Fludem
Copy link

Fludem commented May 3, 2024

Should we disable Chrome Tools in a packaged application? Or is this something that the developer should decide?

@Fludem it's a valid question. I like the flexibility of letting the developer decide... I think the fact that it's in the Window class allows for that.

But what we should have is either:

  1. a sensible default (i.e. we intentionally turn APP_DEBUG=false during the build process); or
  2. show a warning that APP_DEBUG=true at build time.

If we do (1), there's no danger of someone accidentally leaving debug mode on, which has wider implications than just allowing the DevTools to show.

If we only do (2), my feeling is there's a chance that folks either miss it (build output is often messy) or become blind to it.

Yeah I think we should probably go with option 1. Then allow them to pass an argument when they run the command to disable that behavior in case they need a build in debug mode or something

You on board with that?

@avazquez-bit
Copy link
Author

I've tried to change my app debug to false an directly set the function showDevTools ond false, and still appearing

@simonhamp
Copy link
Member

Could the option be appearing in the menu because of the menu configuration? 🤔

I'm just thinking it may having nothing to do with those settings

@Fludem
Copy link

Fludem commented May 4, 2024

Could the option be appearing in the menu because of the menu configuration? 🤔

I'm just thinking it may having nothing to do with those settings

I haven't had a proper look I just skimmed over it, but I thought at first glance it seemed like the logical cause.

I'll take a proper look tonight / maybe tomorrow

@simonhamp simonhamp changed the title [Bug]: Dev console visible from production app Dev console visible from production app May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants