Beispiel #1
0
        private void FindAppsByKnown()
        {
            AddAppByFile(AppLocator.InternetExplorerPath, @"&Internet Explorer");

            if (AppLocator.EdgeProtocolSupported)
            {
                AddAppByShellExpand("microsoft-edge:" + PlhTargetUri, @"&Edge",
                                    AppLocator.EdgePath);
            }

            AddAppByFile(AppLocator.FirefoxPath, @"&Firefox");
            AddAppByFile(AppLocator.OperaPath, @"O&pera");
            AddAppByFile(AppLocator.ChromePath, @"&Google Chrome");
            AddAppByFile(AppLocator.SafariPath, @"&Safari");

            if (NativeLib.IsUnix())
            {
                AddAppByFile(AppLocator.FindAppUnix("epiphany-browser"), @"&Epiphany");
                AddAppByFile(AppLocator.FindAppUnix("galeon"), @"Ga&leon");
                AddAppByFile(AppLocator.FindAppUnix("konqueror"), @"&Konqueror");
                AddAppByFile(AppLocator.FindAppUnix("rekonq"), @"&Rekonq");
                AddAppByFile(AppLocator.FindAppUnix("arora"), @"&Arora");
                AddAppByFile(AppLocator.FindAppUnix("midori"), @"&Midori");
                AddAppByFile(AppLocator.FindAppUnix("Dooble"), @"&Dooble");                 // Upper-case
            }
        }
Beispiel #2
0
        private void FindAppsByKnown()
        {
            if (NativeLib.IsUnix())
            {
                // AppLocator.ChromePath prefers Chrome and falls back to
                // Chromium, therefore try to find Chromium first, in order
                // to prefer the name "Chromium" instead of "Google Chrome"
                AddAppByFile(AppLocator.FindAppUnix("chromium"), "Chromium");
            }

            AddAppByFile(AppLocator.InternetExplorerPath, "Internet Explorer");
            AddAppByFile(AppLocator.FirefoxPath, "Firefox");

            // After looking for Chromium; see above
            AddAppByFile(AppLocator.ChromePath, "Google Chrome");

            AddAppByFile(AppLocator.OperaPath, "Opera");
            AddAppByFile(AppLocator.SafariPath, "Safari");

            if (NativeLib.IsUnix())
            {
                AddAppByFile(AppLocator.FindAppUnix("arora"), "Arora");
                AddAppByFile(AppLocator.FindAppUnix("brave-browser"), "Brave");
                AddAppByFile(AppLocator.FindAppUnix("Dooble"), "Dooble");                 // Upper-case
                AddAppByFile(AppLocator.FindAppUnix("epiphany"), "Epiphany");
                AddAppByFile(AppLocator.FindAppUnix("galeon"), "Galeon");
                AddAppByFile(AppLocator.FindAppUnix("konqueror"), "Konqueror");
                AddAppByFile(AppLocator.FindAppUnix("midori"), "Midori");
                AddAppByFile(AppLocator.FindAppUnix("palemoon"), "Pale Moon");
                AddAppByFile(AppLocator.FindAppUnix("rekonq"), "Rekonq");
                AddAppByFile(AppLocator.FindAppUnix("vivaldi"), "Vivaldi");
            }
        }
Beispiel #3
0
        private static bool ShowHelpLocalKcv(string strQuotedMsIts)
        {
            try
            {
                if (!NativeLib.IsUnix())
                {
                    return(false);
                }

                string strApp = AppLocator.FindAppUnix("kchmviewer");
                if (string.IsNullOrEmpty(strApp))
                {
                    return(false);
                }

                string strFile = StrUtil.GetStringBetween(strQuotedMsIts, 0, ":", "::");
                if (string.IsNullOrEmpty(strFile))
                {
                    strFile = StrUtil.GetStringBetween(strQuotedMsIts, 0, ":", "\"");
                }
                if (string.IsNullOrEmpty(strFile))
                {
                    Debug.Assert(false);
                    return(false);
                }

                string strUrl = StrUtil.GetStringBetween(strQuotedMsIts, 0, "::", "\"");

                // https://www.ulduzsoft.com/linux/kchmviewer/kchmviewer-integration-reference/
                string strArgs = "\"" + SprEncoding.EncodeForCommandLine(strFile) + "\"";
                if (!string.IsNullOrEmpty(strUrl))
                {
                    strArgs = "-showPage \"" + SprEncoding.EncodeForCommandLine(
                        strUrl) + "\" " + strArgs;
                }

                Process p = Process.Start(NativeLib.EncodePath(strApp), strArgs);
                if (p != null)
                {
                    p.Dispose();
                }

                return(true);
            }
            catch (Exception) { Debug.Assert(false); }

            return(false);
        }
Beispiel #4
0
        private void FindAppsByKnown()
        {
            AddAppByFile(AppLocator.InternetExplorerPath, @"&Internet Explorer");
            AddAppByFile(AppLocator.FirefoxPath, @"&Firefox");
            AddAppByFile(AppLocator.OperaPath, @"O&pera");
            AddAppByFile(AppLocator.ChromePath, @"&Google Chrome");
            AddAppByFile(AppLocator.SafariPath, @"&Safari");

            if (NativeLib.IsUnix())
            {
                AddAppByFile(AppLocator.FindAppUnix("epiphany-browser"), @"&Epiphany");
                AddAppByFile(AppLocator.FindAppUnix("arora"), @"&Arora");
                AddAppByFile(AppLocator.FindAppUnix("galeon"), @"Ga&leon");
                AddAppByFile(AppLocator.FindAppUnix("konqueror"), @"&Konqueror");
            }
        }
Beispiel #5
0
        private void FindAppsByKnown()
        {
            string strIE = AppLocator.InternetExplorerPath;

            if (AddAppByFile(strIE, "Internet Explorer"))
            {
                // https://msdn.microsoft.com/en-us/library/hh826025.aspx
                AddAppByShellExpand("cmd://\"" + SprEncoding.EncodeForCommandLine(
                                        strIE) + "\" -private \"" + PlhTargetUri + "\"",
                                    "Internet Explorer (" + KPRes.Private + ")", strIE);
            }

            string strFF = AppLocator.FirefoxPath;

            if (AddAppByFile(strFF, "Firefox"))
            {
                // The command line options -private and -private-window work
                // correctly with Firefox 49.0.1 (before, they did not);
                // https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options
                // https://bugzilla.mozilla.org/show_bug.cgi?id=856839
                // https://bugzilla.mozilla.org/show_bug.cgi?id=829180
                AddAppByShellExpand("cmd://\"" + SprEncoding.EncodeForCommandLine(
                                        strFF) + "\" -private-window \"" + PlhTargetUri + "\"",
                                    "Firefox (" + KPRes.Private + ")", strFF);
            }

            string strCh = AppLocator.ChromePath;

            if (AddAppByFile(strCh, "Google Chrome"))
            {
                // https://www.chromium.org/developers/how-tos/run-chromium-with-flags
                // https://peter.sh/experiments/chromium-command-line-switches/
                AddAppByShellExpand("cmd://\"" + SprEncoding.EncodeForCommandLine(
                                        strCh) + "\" --incognito \"" + PlhTargetUri + "\"",
                                    "Google Chrome (" + KPRes.Private + ")", strCh);
            }

            string strOp = AppLocator.OperaPath;

            if (AddAppByFile(strOp, "Opera"))
            {
                // Doesn't work with Opera 34.0.2036.25:
                // AddAppByShellExpand("cmd://\"" + SprEncoding.EncodeForCommandLine(
                //	strOp) + "\" -newprivatetab \"" + PlhTargetUri + "\"",
                //	"Opera (" + KPRes.Private + ")", strOp);

                // Doesn't work with Opera 36.0.2130.65:
                // AddAppByShellExpand("cmd://\"" + SprEncoding.EncodeForCommandLine(
                //	strOp) + "\" --incognito \"" + PlhTargetUri + "\"",
                //	"Opera (" + KPRes.Private + ")", strOp);

                // Works with Opera 40.0.2308.81:
                AddAppByShellExpand("cmd://\"" + SprEncoding.EncodeForCommandLine(
                                        strOp) + "\" --private \"" + PlhTargetUri + "\"",
                                    "Opera (" + KPRes.Private + ")", strOp);
            }

            AddAppByFile(AppLocator.SafariPath, "Safari");

            if (NativeLib.IsUnix())
            {
                AddAppByFile(AppLocator.FindAppUnix("epiphany-browser"), "Epiphany");
                AddAppByFile(AppLocator.FindAppUnix("galeon"), "Galeon");
                AddAppByFile(AppLocator.FindAppUnix("konqueror"), "Konqueror");
                AddAppByFile(AppLocator.FindAppUnix("rekonq"), "Rekonq");
                AddAppByFile(AppLocator.FindAppUnix("arora"), "Arora");
                AddAppByFile(AppLocator.FindAppUnix("midori"), "Midori");
                AddAppByFile(AppLocator.FindAppUnix("Dooble"), "Dooble");                 // Upper-case
            }
        }
Beispiel #6
0
        private void FindAppsByKnown()
        {
            string strIE = AppLocator.InternetExplorerPath;

            if (AddAppByFile(strIE, @"&Internet Explorer"))
            {
                // https://msdn.microsoft.com/en-us/library/hh826025.aspx
                AddAppByShellExpand("cmd://\"" + strIE + "\" -private \"" +
                                    PlhTargetUri + "\"", "Internet Explorer (" + KPRes.Private + ")", strIE);
            }

            if (AppLocator.EdgeProtocolSupported)
            {
                AddAppByShellExpand("microsoft-edge:" + PlhTargetUri, @"&Edge",
                                    AppLocator.EdgePath);
            }

            string strFF = AppLocator.FirefoxPath;

            if (AddAppByFile(strFF, @"&Firefox"))
            {
                // The command line options -private and -private-window work
                // correctly with Firefox 49.0.1 (before, they did not);
                // https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options
                // https://bugzilla.mozilla.org/show_bug.cgi?id=856839
                // https://bugzilla.mozilla.org/show_bug.cgi?id=829180
                AddAppByShellExpand("cmd://\"" + strFF + "\" -private-window \"" +
                                    PlhTargetUri + "\"", "Firefox (" + KPRes.Private + ")", strFF);
            }

            string strCh = AppLocator.ChromePath;

            if (AddAppByFile(strCh, @"&Google Chrome"))
            {
                // https://www.chromium.org/developers/how-tos/run-chromium-with-flags
                // http://peter.sh/examples/?/chromium-switches.html
                AddAppByShellExpand("cmd://\"" + strCh + "\" --incognito \"" +
                                    PlhTargetUri + "\"", "Google Chrome (" + KPRes.Private + ")", strCh);
            }

            string strOp = AppLocator.OperaPath;

            if (AddAppByFile(strOp, @"O&pera"))
            {
                // Doesn't work with Opera 34.0.2036.25:
                // AddAppByShellExpand("cmd://\"" + strOp + "\" -newprivatetab \"" +
                //	PlhTargetUri + "\"", "Opera (" + KPRes.Private + ")", strOp);

                // Doesn't work with Opera 36.0.2130.65:
                // AddAppByShellExpand("cmd://\"" + strOp + "\" --incognito \"" +
                //	PlhTargetUri + "\"", "Opera (" + KPRes.Private + ")", strOp);

                // Works with Opera 40.0.2308.81:
                AddAppByShellExpand("cmd://\"" + strOp + "\" --private \"" +
                                    PlhTargetUri + "\"", "Opera (" + KPRes.Private + ")", strOp);
            }

            AddAppByFile(AppLocator.SafariPath, @"&Safari");

            if (NativeLib.IsUnix())
            {
                AddAppByFile(AppLocator.FindAppUnix("epiphany-browser"), @"&Epiphany");
                AddAppByFile(AppLocator.FindAppUnix("galeon"), @"Ga&leon");
                AddAppByFile(AppLocator.FindAppUnix("konqueror"), @"&Konqueror");
                AddAppByFile(AppLocator.FindAppUnix("rekonq"), @"&Rekonq");
                AddAppByFile(AppLocator.FindAppUnix("arora"), @"&Arora");
                AddAppByFile(AppLocator.FindAppUnix("midori"), @"&Midori");
                AddAppByFile(AppLocator.FindAppUnix("Dooble"), @"&Dooble");                 // Upper-case
            }
        }