Skip to content

Commit

Permalink
Scope approvals to documentId
Browse files Browse the repository at this point in the history
  • Loading branch information
grod220 committed Jun 19, 2024
1 parent 77d00c0 commit 5615e4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/extension/src/listeners/message-prax-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ chrome.runtime.onMessage.addListener(
// user made a choice
if (status === UserChoice.Approved) {
respond(PraxConnection.Init);
void chrome.tabs.sendMessage(sender.tab!.id!, PraxConnection.Init);
void chrome.tabs.sendMessage(sender.tab!.id!, PraxConnection.Init, {
documentId: sender.documentId, // Ensures tab has not redirected to another url
});
} else {
respond(PraxConnection.Denied);
}
Expand Down
1 change: 1 addition & 0 deletions apps/extension/src/listeners/tabs-updated-prax-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ chrome.tabs.onUpdated.addListener(
url?.startsWith('https://') &&
(await originAlreadyApproved(url))
)
// How can we scope this to documentId?
void chrome.tabs.sendMessage(tabId, PraxConnection.Init);
})(),
);

0 comments on commit 5615e4a

Please sign in to comment.