• Login
Community
  • Login

New commands for "run in browsers"

Scheduled Pinned Locked Moved General Discussion
15 Posts 7 Posters 3.3k Views
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.
  • D
    donho
    last edited by Mar 14, 2019, 12:31 PM

    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.

    A M A 3 Replies Last reply Mar 14, 2019, 12:38 PM Reply Quote 3
    • A
      Alan Kilborn @donho
      last edited by Alan Kilborn Mar 14, 2019, 12:38 PM Mar 14, 2019, 12:38 PM

      @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
      • D
        donho
        last edited by Mar 14, 2019, 1:03 PM

        @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
        • A
          Alan Kilborn
          last edited by Mar 14, 2019, 1:10 PM

          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
          • M
            Meta Chuh moderator @donho
            last edited by Mar 14, 2019, 2:01 PM

            @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
            • P
              PeterJones
              last edited by Mar 14, 2019, 2:07 PM

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

              M 1 Reply Last reply Mar 14, 2019, 2:13 PM Reply Quote 3
              • M
                Meta Chuh moderator @PeterJones
                last edited by Meta Chuh Mar 14, 2019, 2:15 PM Mar 14, 2019, 2:13 PM

                @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
                • P
                  pnedev
                  last edited by Mar 14, 2019, 3:09 PM

                  @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
                  • D
                    donho
                    last edited by Mar 14, 2019, 3:27 PM

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

                    M 2 Replies Last reply Mar 14, 2019, 5:43 PM Reply Quote 2
                    • M
                      Meta Chuh moderator @donho
                      last edited by Mar 14, 2019, 5:43 PM

                      @donho

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

                      1 Reply Last reply Reply Quote 1
                      • M
                        Meta Chuh moderator @donho
                        last edited by Mar 14, 2019, 8:25 PM

                        @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
                        • S
                          SinghRajenM moderator
                          last edited by Mar 16, 2019, 5:19 AM

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

                          M 1 Reply Last reply Mar 16, 2019, 12:09 PM Reply Quote 2
                          • A
                            andrecool-68 @donho
                            last edited by Mar 16, 2019, 9:32 AM

                            @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
                            • M
                              Meta Chuh moderator @SinghRajenM
                              last edited by Meta Chuh Mar 16, 2019, 12:10 PM Mar 16, 2019, 12:09 PM

                              @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
                              • S
                                SinghRajenM moderator
                                last edited by Mar 16, 2019, 12:45 PM

                                @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
                                3 out of 15
                                • First post
                                  3/15
                                  Last post
                                The Community of users of the Notepad++ text editor.
                                Powered by NodeBB | Contributors