Skip to content
Merged
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
6 changes: 3 additions & 3 deletions packages/messaging/src/controllers/sw-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ function getNotificationData(
async function getWindowClient(url: string): Promise<WindowClient | null> {
// Use URL to normalize the URL when comparing to windowClients.
// This at least handles whether to include trailing slashes or not
const parsedURL = new URL(url, self.location.href).href;
const parsedURL = new URL(url, self.location.href);

const clientList = await getClientList();

for (const client of clientList) {
const parsedClientUrl = new URL(client.url, self.location.href).href;
if (parsedClientUrl === parsedURL) {
const parsedClientUrl = new URL(client.url, self.location.href);
if (parsedClientUrl.host === parsedURL.host) {
return client;
}
}
Expand Down