cztomczak / phpdesktop

Develop desktop GUI applications using PHP, HTML5, JavaScript and SQLite
https://groups.google.com/d/forum/phpdesktop
2.7k stars 574 forks source link

Win Chrome 130 - Dialogs, Popup Windows and Dev Tools #336

Open oleteacher opened 3 days ago

oleteacher commented 3 days ago

Thanks for releasing Windows Chrome 130.

I do not think it is my end, have tried on my desktop and laptop.

Cannot get any of the JavaScript alerts to work in dialogs.php

Cannot get the dev tools to show using either f12 or Show Dev Tools (right click). Using right click, there is no log shown, using f12 there is log entry shown.

Maybe this will help:

 17:35:43.922 DEBUG: OnLoadingStateChange: loading=0, url=http://127.0.0.1:64782/dialogs.php
- 17:35:43.000 INFO: GET 200 /favicon.ico
- 17:37:36.125 DEBUG: ClientHandler::OnAfterCreated()
- 17:37:36.125 DEBUG: GetBrowserWindow(): not found, hwnd = 3019194
- 17:37:36.140 DEBUG: BrowserWindow::BrowserWindow() created for Popup
- 17:37:36.140 DEBUG: StoreBrowserWindow(): hwnd = 3019194
- 17:37:36.140 DEBUG: GetBrowserWindow(): not found, hwnd = 0
- 17:37:36.140 DEBUG: Centering popup window relative to its parent
- 17:45:04.984 DEBUG: OnLoadingStateChange: loading=1, url=http://127.0.0.1:64782/dialogs.php
- 17:45:04.094 INFO: GET 200 /dialogs.php
- 17:45:04.109 INFO: GET 200 /style.css
- 17:45:05.672 DEBUG: OnLoadingStateChange: loading=0, url=http://127.0.0.1:64782/dialogs.php
- 17:45:05.765 INFO: GET 200 /favicon.ico
- 17:45:56.765 DEBUG: OnLoadingStateChange: loading=1, url=http://127.0.0.1:64782/dialogs.php
- 17:45:56.859 INFO: GET 200 /dialogs.php
- 17:45:56.875 DEBUG: OnLoadingStateChange: loading=0, url=http://127.0.0.1:64782/dialogs.php
- 17:45:56.969 INFO: GET 200 /favicon.ico
- 17:47:00.687 DEBUG: F12 pressed, opening developer tools

Default dialogs.php debug.log:

-field-trial-handle=4432,i,15068399474415448331,6920777093694457870,262144 --variations-seed-version --enable-logging=handle --log-file=4364 --mojo-platform-channel-handle=4408 /prefetch:8
- 18:00:25.890 DEBUG: OnLoadingStateChange: loading=1, url=http://127.0.0.1:65361/
- 18:00:25.515 DEBUG: OnBrowserCreated()
- 18:00:25.515 ERROR: StoreJavascriptApi() failed, api already exists
- 18:00:25.594 DEBUG: OnContextCreated()
- 18:00:25.969 INFO: GET 200 /dialogs.php
- 18:00:25.984 DEBUG: OnLoadingStateChange: loading=0, url=http://127.0.0.1:65361/dialogs.php
- 18:00:25.078 INFO: GET 200 /favicon.ico
[3892:18700:1110/180028.660:INFO:CONSOLE(0)] "A window.prompt() dialog generated by this page was suppressed because this page is not the active tab of the front window. Please make sure your dialogs are triggered by user interactions to avoid this situation. https://www.chromestatus.com/feature/5637107137642496", source: http://127.0.0.1:65361/dialogs.php (0)
[3892:18700:1110/180029.760:INFO:CONSOLE(0)] "A window.prompt() dialog generated by this page was suppressed because this page is not the active tab of the front window. Please make sure your dialogs are triggered by user interactions to avoid this situation. https://www.chromestatus.com/feature/5637107137642496", source: http://127.0.0.1:65361/dialogs.php (0)
- 18:01:00.953 DEBUG: WM_DESTROY
- 18:01:00.953 DEBUG: RemoveBrowserWindow(): hwnd = 1381480
- 18:01:00.953 INFO: Stopping Mongoose web server
- 18:01:00.953 DEBUG: Mongoose webserver stopped immediately
- 18:01:00.969 DEBUG: OnBeforeClose() hwnd=726084
- 18:01:00.969 DEBUG: RemoveBrowserWindow(): hwnd = 726084
- 18:01:00.984 DEBUG: GetBrowserWindow(): not found, hwnd = 726084
- 18:01:00.984 WARNING: RemoveBrowserWindow() failed: GetBrowserWindow() failed
- 18:01:00.984 DEBUG: Calling CefQuitMessageLoop()
- 18:01:00.172 INFO: Ended application
- 18:01:00.172 INFO: --------------------------------------------------------

Testing a custom dialogs.php debug.log:

- 17:45:56.765 DEBUG: OnLoadingStateChange: loading=1, url=http://127.0.0.1:64782/dialogs.php
- 17:45:56.422 DEBUG: OnContextCreated()
- 17:45:56.422 ERROR: GetJavascriptApi() failed, api not found
- 17:45:56.422 ERROR: GetJavascriptApi() failed in OnContextCreated()
- 17:45:56.422 DEBUG: OnContextCreated()
- 17:45:56.422 ERROR: GetJavascriptApi() failed, api not found
- 17:45:56.422 ERROR: GetJavascriptApi() failed in OnContextCreated()
- 17:45:56.859 INFO: GET 200 /dialogs.php
[24116:24220:1110/174556.746:INFO:CONSOLE(104)] "Uncaught SyntaxError: Unexpected identifier 'confirmMessage'", source: http://127.0.0.1:64782/dialogs.php (104)
- 17:45:56.875 DEBUG: OnLoadingStateChange: loading=0, url=http://127.0.0.1:64782/dialogs.php
- 17:45:56.969 INFO: GET 200 /favicon.ico
[24116:24220:1110/174559.044:INFO:CONSOLE(54)] "Uncaught ReferenceError: showAlert is not defined", source: http://127.0.0.1:64782/dialogs.php (54)
[24116:24220:1110/174600.271:INFO:CONSOLE(56)] "Uncaught ReferenceError: showConfirm is not defined", source: http://127.0.0.1:64782/dialogs.php (56)
[24116:24220:1110/174600.623:INFO:CONSOLE(56)] "Uncaught ReferenceError: showConfirm is not defined", source: http://127.0.0.1:64782/dialogs.php (56)
[24116:24220:1110/174600.857:INFO:CONSOLE(56)] "Uncaught ReferenceError: showConfirm is not defined", source: http://127.0.0.1:64782/dialogs.php (56)
[24116:24220:1110/174601.584:INFO:CONSOLE(58)] "Uncaught ReferenceError: showPrompt is not defined", source: http://127.0.0.1:64782/dialogs.php (58)
[24116:24220:1110/174601.865:INFO:CONSOLE(58)] "Uncaught ReferenceError: showPrompt is not defined", source: http://127.0.0.1:64782/dialogs.php (58)
- 17:47:00.687 DEBUG: F12 pressed, opening developer tools
- 17:54:41.140 DEBUG: WM_DESTROY
- 17:54:41.156 DEBUG: RemoveBrowserWindow(): hwnd = 201864
- 17:54:41.203 DEBUG: OnBeforeClose() hwnd=3019194
- 17:54:41.203 DEBUG: RemoveBrowserWindow(): hwnd = 3019194
- 17:54:41.219 DEBUG: Calling CefQuitMessageLoop()
- 17:54:41.250 DEBUG: OnBeforeClose() hwnd=7210128
- 17:54:41.250 DEBUG: RemoveBrowserWindow(): hwnd = 7210128
- 17:54:41.250 DEBUG: GetBrowserWindow(): not found, hwnd = 7210128
- 17:54:41.250 WARNING: RemoveBrowserWindow() failed: GetBrowserWindow() failed
- 17:54:41.250 DEBUG: Calling CefQuitMessageLoop()
[22280:22440:1110/175441.466:WARNING:sqlite_persistent_store_backend_base.cc(198)] Failed to post task from FlushAndNotifyInBackground@net\extras\sqlite\sqlite_persistent_store_backend_base.cc:248 to client_task_runner_.
- 17:54:41.640 INFO: Ended application
- 17:54:41.640 INFO: --------------------------------------------------------
cztomczak commented 2 days ago

I noticed the issue with dialogs, however devtools worked for me fine. I recall I changed runtime style from chrome to alloy later and I think this may have broken devtools.

cztomczak commented 2 days ago

popups.php works ok for me.

cztomczak commented 2 days ago

Commit https://github.com/cztomczak/phpdesktop/commit/8ceda28bc3464b0a13df69bb2356ad4b449ee7f7 adds runtime_style setting configurable through settings.json.

runtime_style
This option is supported only on some platforms.

Default value: "alloy"

Alternative value is "chrome" which can provide more features and looks similar to native Chrome.

With chrome runtime style dialogs do work ok. Popups look like native Chromium browser with a tab.

I am mostly testing alloy style which hides Chromium styles.

cztomczak commented 2 days ago

Developer Tools fixed in commit https://github.com/cztomczak/phpdesktop/commit/0a04732e9dd141d9054ad05077dd77f5cf279bca.

oleteacher commented 2 days ago

Thank you for looking into!

cztomczak commented 2 days ago

Dialogs don't work due to bug in upstream CEF: https://github.com/chromiumembedded/cef/issues/3818 https://magpcss.org/ceforum/viewtopic.php?f=6&t=20041

cztomczak commented 1 day ago

New release 130.1 is ready: https://github.com/cztomczak/phpdesktop/releases/tag/chrome-v130.1

oleteacher commented 1 day ago

That is great Czarek. Thank you. Will close this now.

oleteacher commented 1 day ago

No popup dialogs shown. Thought you may find this helpful:

- 11:50:15.672 DEBUG: JS dialog: Test alert
- 11:50:17.672 DEBUG: JS dialog: Test confirm
- 11:50:17.672 INFO: JS Console: [Warning] A window.confirm() dialog generated by this page was suppressed because this page is not the active tab of the front window. Please make sure your dialogs are triggered by user interactions to avoid this situation. https://www.chromestatus.com/feature/5140698722467840(http://127.0.0.1:50988/dialogs.php:0)
- 11:50:18.859 DEBUG: JS dialog: Test
- 11:50:18.859 INFO: JS Console: [Warning] A window.prompt() dialog generated by this page was suppressed because this page is not the active tab of the front window. Please make sure your dialogs are triggered by user interactions to avoid this situation. https://www.chromestatus.com/feature/5637107137642496(http://127.0.0.1:50988/dialogs.php:0)
cztomczak commented 1 day ago

JS dialogs are still unfixed, so you may re-open this. Dialogs will be fixed when it's fixed in upstream and phpdesktop updates Chromium version to sync with upstream.