@@ -35,6 +35,7 @@ define(function (require, exports, module) {
3535 PerfUtils = brackets . getModule ( "utils/PerfUtils" ) ,
3636 StringUtils = brackets . getModule ( "utils/StringUtils" ) ,
3737 Dialogs = brackets . getModule ( "widgets/Dialogs" ) ,
38+ DefaultDialogs = brackets . getModule ( "widgets/DefaultDialogs" ) ,
3839 Strings = brackets . getModule ( "strings" ) ,
3940 PreferencesManager = brackets . getModule ( "preferences/PreferencesManager" ) ,
4041 LocalizationUtils = brackets . getModule ( "utils/LocalizationUtils" ) ,
@@ -72,6 +73,7 @@ define(function (require, exports, module) {
7273 DEBUG_SWITCH_LANGUAGE = "debug.switchLanguage" ,
7374 DEBUG_ENABLE_LOGGING = "debug.enableLogging" ,
7475 DEBUG_ENABLE_PHNODE_INSPECTOR = "debug.enablePhNodeInspector" ,
76+ DEBUG_GET_PHNODE_INSPECTOR_URL = "debug.getPhNodeInspectorURL" ,
7577 DEBUG_LIVE_PREVIEW_LOGGING = "debug.livePreviewLogging" ,
7678 DEBUG_OPEN_VFS = "debug.openVFS" ,
7779 DEBUG_OPEN_EXTENSION_FOLDER = "debug.openExtensionFolders" ,
@@ -702,6 +704,25 @@ define(function (require, exports, module) {
702704 _updateLogToConsoleMenuItemChecked ( ) ;
703705 }
704706
707+ function _handleGetPhNodeInspectURL ( ) {
708+ Dialogs . showModalDialog ( DefaultDialogs . DIALOG_ID_INFO , Strings . CMD_GET_PHNODE_INSPECTOR_URL ,
709+ `<div id="instructions">
710+ <p>
711+ 1. Go to <a href="chrome://inspect/" target="_blank">chrome://inspect/#devices</a>
712+ <button onclick="Phoenix.app.copyToClipboard('chrome://inspect/')">
713+ <i class="fas fa-copy"></i> Copy
714+ </button>
715+ </p>
716+ <p>2. Select Option 'Open dedicated DevTools for Node'</p>
717+ <p>
718+ 3. Use the URL in connection tab'<code>localhost:${ window . PhNodeEngine . getInspectPort ( ) } </code>'
719+ <button onclick="Phoenix.app.copyToClipboard('localhost:${ window . PhNodeEngine . getInspectPort ( ) } ')">
720+ <i class="fas fa-copy"></i> Copy
721+ </button>
722+ </p>
723+ </div>` ) ;
724+ }
725+
705726 function _handleLivePreviewLogging ( ) {
706727 window . toggleLoggingKey ( LOG_LIVE_PREVIEW_KEY ) ;
707728 _updateLogToConsoleMenuItemChecked ( ) ;
@@ -757,6 +778,7 @@ define(function (require, exports, module) {
757778
758779 CommandManager . register ( Strings . CMD_ENABLE_LOGGING , DEBUG_ENABLE_LOGGING , _handleLogging ) ;
759780 CommandManager . register ( Strings . CMD_ENABLE_PHNODE_INSPECTOR , DEBUG_ENABLE_PHNODE_INSPECTOR , _handlePhNodeInspectEnable ) ;
781+ CommandManager . register ( Strings . CMD_GET_PHNODE_INSPECTOR_URL , DEBUG_GET_PHNODE_INSPECTOR_URL , _handleGetPhNodeInspectURL ) ;
760782 CommandManager . register ( Strings . CMD_ENABLE_LIVE_PREVIEW_LOGS , DEBUG_LIVE_PREVIEW_LOGGING , _handleLivePreviewLogging ) ;
761783 CommandManager . register ( Strings . CMD_OPEN_VFS , DEBUG_OPEN_VFS , _openVFS ) ;
762784 CommandManager . register ( Strings . CMD_OPEN_EXTENSIONS_FOLDER , DEBUG_OPEN_EXTENSION_FOLDER , _openExtensionsFolder ) ;
@@ -782,6 +804,9 @@ define(function (require, exports, module) {
782804 debugMenu . addMenuItem ( DEBUG_ENABLE_PHNODE_INSPECTOR , undefined , undefined , undefined , {
783805 hideWhenCommandDisabled : true
784806 } ) ;
807+ debugMenu . addMenuItem ( DEBUG_GET_PHNODE_INSPECTOR_URL , undefined , undefined , undefined , {
808+ hideWhenCommandDisabled : true
809+ } ) ;
785810 debugMenu . addMenuItem ( DEBUG_LIVE_PREVIEW_LOGGING ) ;
786811 debugMenu . addMenuDivider ( ) ;
787812 debugMenu . addMenuItem ( DEBUG_OPEN_VFS ) ;
@@ -798,6 +823,8 @@ define(function (require, exports, module) {
798823 . setEnabled ( Phoenix . browser . isTauri ) ; // only show in tauri
799824 CommandManager . get ( DEBUG_ENABLE_PHNODE_INSPECTOR )
800825 . setEnabled ( Phoenix . browser . isTauri ) ; // only show in tauri
826+ CommandManager . get ( DEBUG_GET_PHNODE_INSPECTOR_URL )
827+ . setEnabled ( Phoenix . browser . isTauri ) ; // only show in tauri
801828 CommandManager . get ( DEBUG_OPEN_VIRTUAL_SERVER )
802829 . setEnabled ( ! Phoenix . browser . isTauri ) ; // don't show in tauri as there is no virtual server in tauri
803830
0 commit comments