New commands for "run in browsers"
-
@Alan-Kilborn said:
How about having them back right where the used to be, with the same names they had
Technically itās difficult to do it, and also itās rather the place for the customized macros and shortcuts commands.
Thatās why these new commands need a new place. -
Another advantage to having them where they were (Run menu) is they can be tweaked by the user, or at the very least copied as a model. If they are āhardcodedā somewhere else, there is no tweaking/copying, and the burden of adding a new one (e.g. āEdgeā seems popular) is all on the developer! :)
-
i would put Launch in Edge to the list, instead of ie, as it has been requested a few times.
the execution is via shell api:
<Command name="Launch in Edge" Ctrl="yes" Alt="yes" Shift="yes" Key="69">shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge $(FULL_CURRENT_PATH)</Command>
so it would be:
- Chrome
- Edge
- Firefox
(if you choose to minimise it to three options).
the internet explorer can be added by the user to the run menu as usual.
what do you think ?
-
Maybe put them in a submenu of the Tools menu, like Tools > Launch or Tools > Run Current File Withā¦
I think the reason Don doesnāt want it in the customizable Run menu is because that came up in the EU-FOSSA review thingy. By doing it internally, there might be a way to check the āvalidityā of the browser before launching with it ā though I sure donāt see how.
Besides, even if itās not active by default, as long as we still get
shortcuts.xml
to be able to add things to the Run menu (at our own risk), we can still advise people how to put them where they used to be, or add browsers that arenāt included by default in Notepad++'s internal list. -
@PeterJones wording of browser validation brings up a new idea in my head.
feature: only list the
launch in [browsername]
options if the browser exists on that machine.so if someone does not have firefox.exe, the
launch in firefox
menu entry would be omitted.ps: would be a nice feature, but not a must have, as it is more difficult to implement.
this way you could also put in more or all browsers, as users usually donāt have more than 2-3 installed. -
@donho , All,
Sorry if Iām missing or overlooking something but isnāt it better to have
Launch in System Default Browser
instead of all others? -
Another advantage to having them where they were (Run menu) is they can be tweaked by the user, or at the very least copied as a model.
The new commands are the normal commands like
New
,Close
orAlways on the Top
, so thereās no way user can tweak them.āEdgeā seems popular
I donāt know yet how get Edgeās full file path in Win32 API. If you have any idea, please let me know.
-
the command line for edge is:
shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge $(FULL_CURRENT_PATH)
-
ps: translated to c++, the microsoft edge browser call could be something like this:
ShellExecute(NULL, "shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge", buf->getFullPathName(), NULL, NULL, SW_SHOW); // or ShellExecuteA(NULL, "open", "shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge", buf->getFullPathName(), prog2LaunchDir, SW_SHOWNORMAL);
note: if you ask yourself, why the hell this dude (me š) wrote
shell:Appsfolder ...
in a command line !?!:
you can not runMicrosoftEdge.exe
directly, so you have to use the shell api.ps to @SinghRajenM : if you are around, did i get the c++ syntax half way right ?
-
@Meta-Chuh
C++ syntax looks fine. šIn my opinion your solution may work but does not look perfect (Note: this is my personal opinion which should not hurt you š).
In past (around 2015 when edge was evolving) I have written code using COM to detect Edge is installed or not. But that time MS used to call Edge as spartan browser. I feel this stands true internally today as well, but not sure.
Anyway, to launch Edge, we use command
microsoft-edge:
(without url) andmicrosoft-edge:htpp://www.google.com
(with url) in run window.We can leverage the same in c++ like below -
ShellExecuteA(NULL, "open", "microsoft-edge:http://www.google.com", NULL, NULL, SW_SHOWNORMAL);
-
@donho
The Macros and Run commands store their entries in a single file (shortcuts.xml). Is it possible to divide this into two independent files? -
Note: this is my personal opinion which should not hurt you š
loool ā¦ donāt worry, every alternative that works will never hurt me, nor anyone with a goal to solve. š
i benefit from your knowledge and passion, and in my mind you are very solution oriented.
once you find something, you usually present a working alternative, together with an explanation, followed by a lot of proactive testing on your own initiative.this is much appreciated and one of the reasons why i enjoy to ask for your opinion. š
-
@Meta-Chuh I am so grateful for your generous words. Itās a special art which is not very common unfortunately. And we are fortunate that we have you with it.