Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ jobs:
/nologo
/v:minimal

- name: Run unit tests
shell: pwsh
run: >
dotnet test
src/extension/WcpBrowserTabs/WcpBrowserTabs.Tests/WcpBrowserTabs.Tests.csproj
--configuration Debug
/p:Platform=x64

- name: Build PR Store bundle
shell: pwsh
run: |
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: ui-tests

on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ui-tests-${{ github.ref }}
cancel-in-progress: false

jobs:
browser-ui-tests:
runs-on: windows-2022

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET 9 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Verify Windows SDK platform
shell: pwsh
run: |
$platformXml = "C:\Program Files (x86)\Windows Kits\10\Platforms\UAP\10.0.22621.0\Platform.xml"
if (-not (Test-Path $platformXml)) {
Write-Host "Installed UAP SDK platforms:"
Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\Platforms\UAP" -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty FullName
throw "Required Windows SDK UAP platform file not found: $platformXml"
}

- name: Run unit tests with coverage
shell: pwsh
run: >
dotnet test
src/extension/WcpBrowserTabs/WcpBrowserTabs.Tests/WcpBrowserTabs.Tests.csproj
--configuration Debug
--settings src/extension/WcpBrowserTabs/WcpBrowserTabs.Tests/coverage.runsettings
--collect "XPlat Code Coverage"
--logger "trx;LogFileName=unit-tests.trx"
--results-directory artifacts/unit-tests
/p:Platform=x64

- name: Run browser UI tests
shell: pwsh
run: >
dotnet test
src/extension/WcpBrowserTabs/WcpBrowserTabs.UiTests/WcpBrowserTabs.UiTests.csproj
--configuration Debug
--filter Category=Ui
--settings src/extension/WcpBrowserTabs/WcpBrowserTabs.UiTests/coverage.runsettings
--collect "XPlat Code Coverage"
--logger "trx;LogFileName=ui-tests.trx"
--results-directory artifacts/ui-tests
/p:Platform=x64

- name: Upload UI test results
if: always()
uses: actions/upload-artifact@v4
with:
name: ui-test-results
path: |
artifacts/unit-tests
artifacts/ui-tests
if-no-files-found: ignore
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-dotnettools.csdevkit",
"github.vscode-github-actions"
]
}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This repository contains a Windows Command Palette extension named **Browser Tabs**.

- It discovers open browser tabs from supported browsers (currently Chrome and Edge).
- It discovers open browser tabs from supported browsers (currently Chrome, Edge, and Firefox).
- It shows those tabs in Command Palette so users can search and switch quickly.
- It is implemented as a COM-based Windows app extension.

Expand Down
2 changes: 1 addition & 1 deletion PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Browser Tabs is a Windows Command Palette extension that helps you find and switch to open browser tabs.

Browser Tabs runs locally on your Windows device. It reads the titles of open Chrome and Microsoft Edge tabs through Windows UI Automation so those tabs can be shown in Command Palette search results.
Browser Tabs runs locally on your Windows device. It reads the titles of open Chrome, Microsoft Edge, and Firefox tabs through Windows UI Automation so those tabs can be shown in Command Palette search results.

Browser Tabs does not send browser tab titles, browsing activity, account information, or other personal data to a remote service. Browser Tabs does not require an account and does not operate a backend service.

Expand Down
13 changes: 7 additions & 6 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ Use this draft listing copy.
Short description:

```text
Switch to open Chrome and Edge tabs directly from Windows Command Palette.
Switch to open Chrome, Edge, and Firefox tabs directly from Windows Command Palette.
```

Description:

```text
Browser Tabs integrates with Windows Command Palette to make open browser tabs searchable from one launcher. It discovers open Chrome and Microsoft Edge tabs on your Windows desktop, shows matching tabs in Command Palette, and switches directly to the selected tab.
Browser Tabs integrates with Windows Command Palette to make open browser tabs searchable from one launcher. It discovers open Chrome, Microsoft Edge, and Firefox tabs on your Windows desktop, shows matching tabs in Command Palette, and switches directly to the selected tab.

This extension requires Microsoft PowerToys Command Palette to be installed and enabled. Browser tab discovery runs locally on your device using Windows UI Automation. Browser Tabs does not send your browser tab data to a remote service.
```
Expand All @@ -182,6 +182,7 @@ Features:
```text
Search open Chrome tabs
Search open Microsoft Edge tabs
Search open Firefox tabs
Switch directly to a selected tab
Highlights currently active tabs
Runs locally as a Command Palette extension
Expand All @@ -190,7 +191,7 @@ Runs locally as a Command Palette extension
Keywords:

```text
command palette, powertoys, browser tabs, chrome, edge, tab switcher, productivity
command palette, powertoys, browser tabs, chrome, edge, firefox, tab switcher, productivity
```

Screenshots:
Expand Down Expand Up @@ -239,7 +240,7 @@ Recommended screenshot set:
Suggested captions:

```text
Search open Chrome and Edge tabs from Windows Command Palette.
Search open Chrome, Edge, and Firefox tabs from Windows Command Palette.
Filter browser tabs by title, browser, or window text.
Switch directly to the selected browser tab.
Runs locally as a PowerToys Command Palette extension.
Expand All @@ -256,13 +257,13 @@ Certification note:
```text
Browser Tabs is a Windows Command Palette extension, not a standalone app. Its app-list entry is disabled intentionally because users launch it through Microsoft PowerToys Command Palette. If the package executable is launched directly, it shows an informational dialog explaining that Browser Tabs must be opened from Command Palette.

To test it, install and enable Microsoft PowerToys Command Palette, open Chrome or Microsoft Edge with several tabs, launch Command Palette, open Browser Tabs, search for a tab title, and select a result. The extension should bring the browser window forward and activate the selected tab. No account, network service, or test credentials are required.
To test it, install and enable Microsoft PowerToys Command Palette, open Chrome, Microsoft Edge, or Firefox with several tabs, launch Command Palette, open Browser Tabs, search for a tab title, and select a result. The extension should bring the browser window forward and activate the selected tab. No account, network service, or test credentials are required.
```

Restricted capability explanation for `runFullTrust`:

```text
Browser Tabs declares runFullTrust because Command Palette extensions use an out-of-process COM server and packaged COM registration. The extension runs as a desktop Command Palette extension, enumerates local Chrome and Microsoft Edge window/tab UI Automation elements, and activates the selected local browser tab. It does not use runFullTrust to elevate privileges, install services, modify system settings, or access user files.
Browser Tabs declares runFullTrust because Command Palette extensions use an out-of-process COM server and packaged COM registration. The extension runs as a desktop Command Palette extension, enumerates local Chrome, Microsoft Edge, and Firefox window/tab UI Automation elements, and activates the selected local browser tab. It does not use runFullTrust to elevate privileges, install services, modify system settings, or access user files.
```

Useful Microsoft docs:
Expand Down
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# wcp-browsertabs

Browser Tabs is a Windows Command Palette extension for searching and switching between open Chrome and Microsoft Edge tabs.
Browser Tabs is a Windows Command Palette extension for searching and switching between open Chrome, Microsoft Edge, and Firefox tabs.

Install it from the Microsoft Store:

Expand All @@ -10,12 +10,12 @@ https://apps.microsoft.com/detail/9N7BMMLTGFWX

- Windows 10 version 2004 or later
- Microsoft PowerToys with Command Palette enabled
- Chrome or Microsoft Edge
- Chrome, Microsoft Edge, or Firefox

## Usage

1. Install `wcp-browsertabs` from the Microsoft Store.
2. Open Chrome or Microsoft Edge with a few tabs.
2. Open Chrome, Microsoft Edge, or Firefox with a few tabs.
3. Open PowerToys Command Palette.
4. Open **Browser Tabs**.
5. Search by tab title, browser, or window title.
Expand Down Expand Up @@ -43,6 +43,35 @@ Build:
dotnet build src\extension\WcpBrowserTabs\WcpBrowserTabs.sln
```

Run unit tests:

```powershell
dotnet test src\extension\WcpBrowserTabs\WcpBrowserTabs.Tests\WcpBrowserTabs.Tests.csproj /p:Platform=x64
```

Run unit tests with coverage:

```powershell
dotnet test src\extension\WcpBrowserTabs\WcpBrowserTabs.Tests\WcpBrowserTabs.Tests.csproj --settings src\extension\WcpBrowserTabs\WcpBrowserTabs.Tests\coverage.runsettings --collect "XPlat Code Coverage" --results-directory artifacts\unit-tests /p:Platform=x64
```

Run browser UI integration tests:

```powershell
dotnet test src\extension\WcpBrowserTabs\WcpBrowserTabs.UiTests\WcpBrowserTabs.UiTests.csproj --filter Category=Ui /p:Platform=x64
```

Run browser UI integration tests with coverage:

```powershell
dotnet test src\extension\WcpBrowserTabs\WcpBrowserTabs.UiTests\WcpBrowserTabs.UiTests.csproj --filter Category=Ui --settings src\extension\WcpBrowserTabs\WcpBrowserTabs.UiTests\coverage.runsettings --collect "XPlat Code Coverage" --results-directory artifacts\ui-tests /p:Platform=x64
```

The UI tests launch Chrome, Microsoft Edge, and Firefox with temporary profiles
and local test pages. Tests for browsers that are not installed are skipped.
Coverage output is written as Cobertura XML under `artifacts\unit-tests\` or
`artifacts\ui-tests\`.

Create a Store bundle using the current package version:

```powershell
Expand Down
21 changes: 21 additions & 0 deletions scripts/build-and-install-local.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
param(
[string]$WorkspaceFolder = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path,
[switch]$UseManifestVersion
)

$ErrorActionPreference = "Stop"

$workspace = (Resolve-Path $WorkspaceFolder).Path

$packageScript = Join-Path $PSScriptRoot "package-extension-x64.ps1"
$trustScript = Join-Path $PSScriptRoot "trust-latest-dev-certificate.ps1"
$installScript = Join-Path $PSScriptRoot "install-latest-package.ps1"

Write-Host "Building local x64 package..."
& $packageScript -WorkspaceFolder $workspace -UseManifestVersion:$UseManifestVersion

Write-Host "Trusting latest development certificate..."
& $trustScript -WorkspaceFolder $workspace

Write-Host "Installing latest local package..."
& $installScript -WorkspaceFolder $workspace
6 changes: 6 additions & 0 deletions src/Poc/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ private static bool TryGetBrowserName(int processId, out string browser)
return true;
}

if (processName.Equals("firefox", StringComparison.OrdinalIgnoreCase))
{
browser = "Firefox";
return true;
}

return false;
}
catch (ArgumentException)
Expand Down
5 changes: 5 additions & 0 deletions src/extension/WcpBrowserTabs/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Interop.UIAutomationClient" Version="10.19041.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="Microsoft.CommandPalette.Extensions" Version="0.2.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.24508.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.2.46-beta" />
<PackageVersion Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
Expand All @@ -14,5 +16,8 @@
<PackageVersion Include="Shmuelie.WinRTServer" Version="2.1.1" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="System.Text.Json" Version="9.0.5" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
</ItemGroup>
</Project>
Loading
Loading