This is a migrated thread and some comments may be shown as answers.

Host Remapping and window size

3 Answers 149 Views
Extensions and Customization
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 14 Nov 2019, 04:12 PM
The feature I use and change most often is the Tools--> HOSTS... window for Host Remapping. However the popup dialog window is unfortunately very small, doesn't remember its new size when resizing, and closes itself on save. Further the ctrl-arrow-key movement prefers bigger jumps. 

Is it possible to create an extension that affects this window's default size?
Is it possible to edit/save the contents of the window from another app such as Notepad++?

I've sadly been unable to find much of anything relating to it in the extension creation documentation.

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Boby
Telerik team
answered on 19 Nov 2019, 01:47 PM

Hello Benjamin,

It's not possible to create extension for modifying the size of the window, as the default HOSTS functionality is internally implemented as extension itself and doesn't provide such extensibility points.

It should be possible to edit the file with external editor, with some limitations. On first enabling of the extension, the HOSTS.txt file is created in the settings folder (by default C:\Users\<username>\Documents\Fiddler2), which could be edited in any editor. The rules from the file are loaded back in the extension on startup and on saving in the original Hosts Remapping dialog.

Regards,
Boby
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Benjamin
Top achievements
Rank 1
answered on 20 Nov 2019, 05:41 PM
Thanks for the reply and info.

Not having any sort of trigger/hook to reload the file outside of a restart or dialog-save-click, nor even the ability to create a toolbar button instead of going through the current menu option and then saving the dialog, mostly spoils my ideas to make my frequent edit experience smoother. I'll have to suck it up until more options come along. 

Thanks again,
-Ben
0
Benjamin
Top achievements
Rank 1
answered on 30 Apr 2020, 06:19 PM
Update for anyone finding this. I've been able to create a partial work-around by using the 3rd party automation program AutoHotKey. Below is the hopefully easy to understand code I'm using with that, which I'm providing here with no warranty but also no restriction. 

;Hotkey for opening the host remapwindow ^=ctrl, +=shift, a=a
 
FocusFiddler() {
    ;Open Fiddler if it's not open.
    if  WinExist("ahk_exe Fiddler.exe")
    { } else {
        Run, C:\Users\[user]\AppData\Local\Programs\Fiddler\Fiddler.exe, C:\Users\[user]\AppData\Local\Programs\Fiddler
        Sleep, 7000
    }
     
    ;If Fiddler is open...
    if WinExist("ahk_exe Fiddler.exe")
    {
        WinActivate, Progress Telerik Fiddler Web Debugger
        Sleep, 250
        }
    else
    {
    return false
    }
    return true
}
 
^+a::
    isFocused := FocusFiddler()
    if (isFocused = false) {
        Exit
    }  
     
    WinGetActiveTitle, curwin
    If curwin = Progress Telerik Fiddler Web Debugger
    {
        Send !th
        Sleep, 250
        WinGetActiveTitle, curwin
    }
     
    If curwin = Host Remapping
    {
        ;Move and expand Host Remapping window so it's readable
        WinMove, A, , 0, 10, 1000, 1000
    }
 
 
^!+a::
    ;Get current window
    startwindow:= WinExist("A")
 
    isFocused := FocusFiddler()
    if (isFocused = false) {
        Exit
    }  
     
    WinActivate, Progress Telerik Fiddler Web Debugger
    Sleep, 250
     
    WinGetActiveTitle, curwin
    If curwin = Progress Telerik Fiddler Web Debugger
    {
        Send !th
        Sleep, 250
        WinGetActiveTitle, curwin
    }
     
    If curwin = Host Remapping
    {
        ;Move and expand Host Remapping window so it's readable
        WinMove, A, , 0, 10, 1000, 1000
        Sleep, 250
         
        ControlGetText, HostsText, WindowsForms10.EDIT.app.0.13965fa_r6_ad11, Host Remapping
        newText := "127.0.0.1 " . clipboard . Chr(13) . Chr(10) . HostsText
        ControlSetText, WindowsForms10.EDIT.app.0.13965fa_r6_ad11, %newText%, Host Remapping
    }


Tags
Extensions and Customization
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Boby
Telerik team
Benjamin
Top achievements
Rank 1
Share this question
or