Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerToys Run Web Search plugin can't open Arc #32782

Open
hankyusa opened this issue May 9, 2024 · 4 comments
Open

PowerToys Run Web Search plugin can't open Arc #32782

hankyusa opened this issue May 9, 2024 · 4 comments
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface

Comments

@hankyusa
Copy link

hankyusa commented May 9, 2024

Microsoft PowerToys version

0.80.1

Installation method

Microsoft Store

Running as admin

No

Area(s) with issue?

PowerToys Run

Steps to reproduce

  1. Set the default browser as Arc.
  2. Enable PoerToys Run and the built-in Web Search plugin with direct activation command set to "??".
  3. Trigger PowerToys Run, type "?? my search query".
  4. Select the "Search the web in Arc" option.

✔️ Expected Behavior

Open a new tab in Arc and navigate to search results page for "my search query".

❌ Actual Behavior

Sometimes an error message appears saying "Failed to open Arc". Other times focus switches to Arc, but no new tab is opened.

Other Software

Arc from The Browser Company

  • Build Info: 1.0.1.24682 (0000)
  • OS Version: 10.0.22621
  • Chromium Engine Version 124.0.6367.92
@hankyusa hankyusa added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels May 9, 2024
Copy link

github-actions bot commented May 9, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@hankyusa
Copy link
Author

hankyusa commented May 9, 2024

Possible duplicate of #31803.

@hankyusa
Copy link
Author

hankyusa commented May 9, 2024

I can't find Arc on the Microsoft Store, but according to u/itmeBlurb "it installs using Microsoft's App Installer format, which is ran through the MS Store."

This makes me believe the issue is Wox.Plugin.Common.DefaultBrowserInfo.Path since that had a similar issue (#19260) when Firefox was installed through the Microsoft Store. I think the fix (#20350) should be similar.

I was going to submit a pull request, but don't really know what I'm doing. Here's my the change I'd make to src/modules/launcher/Wox.Plugin/Common/DefaultBrowserInfo.cs.

                    // HACK: for browsers installed through Microsoft Store
                    // When installed through Microsoft Store the commandPattern does not have
                    // quotes for the path. As the Program Files does have a space
                    // the extracted path would be invalid, here we add the quotes to fix it.
                    const string ArcExecutableName = "arc.exe";
                    const string FirefoxExecutableName = "firefox.exe";
                    string executableName = commandPattern.Contains(ArcExecutableName) ? ArcExecutableName : commandPattern.Contains(FirefoxExecutableName) ? FirefoxExecutableName : '';
                    if (!string.IsNullOrEmpty(executableName) && commandPattern.Contains(@"\WindowsApps\") && (!commandPattern.StartsWith('\"')))
                    {
                        var pathEndIndex = commandPattern.IndexOf(executableName, StringComparison.Ordinal) + executableName.Length;
                        commandPattern = commandPattern.Insert(pathEndIndex, "\"");
                        commandPattern = commandPattern.Insert(0, "\"");
                    }

@ethanfangg ethanfangg added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface labels May 10, 2024
@ethanfangg
Copy link
Contributor

I can't find Arc on the Microsoft Store, but according to u/itmeBlurb "it installs using Microsoft's App Installer format, which is ran through the MS Store."

This makes me believe the issue is Wox.Plugin.Common.DefaultBrowserInfo.Path since that had a similar issue (#19260) when Firefox was installed through the Microsoft Store. I think the fix (#20350) should be similar.

I was going to submit a pull request, but don't really know what I'm doing. Here's my the change I'd make to src/modules/launcher/Wox.Plugin/Common/DefaultBrowserInfo.cs.

                    // HACK: for browsers installed through Microsoft Store
                    // When installed through Microsoft Store the commandPattern does not have
                    // quotes for the path. As the Program Files does have a space
                    // the extracted path would be invalid, here we add the quotes to fix it.
                    const string ArcExecutableName = "arc.exe";
                    const string FirefoxExecutableName = "firefox.exe";
                    string executableName = commandPattern.Contains(ArcExecutableName) ? ArcExecutableName : commandPattern.Contains(FirefoxExecutableName) ? FirefoxExecutableName : '';
                    if (!string.IsNullOrEmpty(executableName) && commandPattern.Contains(@"\WindowsApps\") && (!commandPattern.StartsWith('\"')))
                    {
                        var pathEndIndex = commandPattern.IndexOf(executableName, StringComparison.Ordinal) + executableName.Length;
                        commandPattern = commandPattern.Insert(pathEndIndex, "\"");
                        commandPattern = commandPattern.Insert(0, "\"");
                    }

@hankyusa, @jaimecbernardo might be able to help consult here if you submit a PR, does look similar to #19260 and the fix #20350

@ethanfangg ethanfangg removed the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

No branches or pull requests

2 participants