Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    New commands for "run in browsers"

    General Discussion
    7
    15
    2596
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • donho
      donho last edited by

      Hi there,

      For the security reason, 5 default customized shortcuts Launch in Firefox, Launch in IE, Launch in Chrome, Launch in Safari and Send via Outlook have been removed from the v7.6.4:
      https://github.com/notepad-plus-plus/notepad-plus-plus/commit/c1bf412f5737aa30f3f90ddaea57b2d8effbbea9

      It seems they are useful though. I’m restoring at least 3 commands Launch in Firefox, Launch in IE, and Launch in Chrome by doing a new implementation in v7.6.4.

      I would like to have your opinions/ideas for the places of these 3 commands (and new names) in current menu. Thank you in advance.

      Alan Kilborn Meta Chuh andrecool-68 3 Replies Last reply Reply Quote 3
      • Alan Kilborn
        Alan Kilborn @donho last edited by Alan Kilborn

        @donho

        How about having them back right where the used to be, with the same names they had? Unless there is a great reason for change, this makes “support” continuity easier… :)

        1 Reply Last reply Reply Quote 1
        • donho
          donho last edited by

          @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.

          1 Reply Last reply Reply Quote 3
          • Alan Kilborn
            Alan Kilborn last edited by

            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! :)

            1 Reply Last reply Reply Quote 2
            • Meta Chuh
              Meta Chuh @donho last edited by

              @donho

              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 ?

              1 Reply Last reply Reply Quote 2
              • PeterJones
                PeterJones last edited by

                @donho,

                Maybe put them in a submenu of the Tools menu, like Tools > Launch or Tools > Run Current File With…

                @Alan-Kilborn,

                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.

                Meta Chuh 1 Reply Last reply Reply Quote 3
                • Meta Chuh
                  Meta Chuh @PeterJones last edited by Meta Chuh

                  @donho

                  @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.

                  1 Reply Last reply Reply Quote 2
                  • pnedev
                    pnedev last edited by

                    @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?

                    1 Reply Last reply Reply Quote 0
                    • donho
                      donho last edited by

                      @Alan-Kilborn

                      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 or Always 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.

                      Meta Chuh 2 Replies Last reply Reply Quote 2
                      • Meta Chuh
                        Meta Chuh @donho last edited by

                        @donho

                        the command line for edge is:
                        shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge $(FULL_CURRENT_PATH)

                        1 Reply Last reply Reply Quote 1
                        • Meta Chuh
                          Meta Chuh @donho last edited by

                          @donho

                          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 run MicrosoftEdge.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 ?

                          1 Reply Last reply Reply Quote 4
                          • SinghRajenM
                            SinghRajenM last edited by

                            @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) and microsoft-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);

                            Meta Chuh 1 Reply Last reply Reply Quote 2
                            • andrecool-68
                              andrecool-68 @donho last edited by

                              @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?

                              1 Reply Last reply Reply Quote 2
                              • Meta Chuh
                                Meta Chuh @SinghRajenM last edited by Meta Chuh

                                @SinghRajenM

                                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. 👍

                                1 Reply Last reply Reply Quote 1
                                • SinghRajenM
                                  SinghRajenM last edited by

                                  @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.

                                  1 Reply Last reply Reply Quote 1
                                  • First post
                                    Last post
                                  Copyright © 2014 NodeBB Forums | Contributors