Skip to content

Commit

Permalink
feat: change fido2 filters to allow scripts on localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
coroiu committed Jun 10, 2024
1 parent 2961d8c commit d0a116c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Fido2Background implements Fido2BackgroundInterface {
runAt: "document_start",
};
private readonly sharedRegistrationOptions: SharedFido2ScriptRegistrationOptions = {
matches: ["https://*/*"],
matches: ["https://*/*", "http://localhost/*"],
excludeMatches: ["https://*/*.xml*"],
allFrames: true,
...this.sharedInjectionDetails,
Expand Down
4 changes: 3 additions & 1 deletion apps/browser/src/vault/fido2/content/content-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import { MessageWithMetadata, Messenger } from "./messaging/messenger";
(function (globalContext) {
const shouldExecuteContentScript =
globalContext.document.contentType === "text/html" &&
globalContext.document.location.protocol === "https:";
(globalContext.document.location.protocol === "https:" ||
(globalContext.document.location.protocol === "http:" &&
globalContext.document.location.hostname === "localhost"));

if (!shouldExecuteContentScript) {
return;
Expand Down
4 changes: 3 additions & 1 deletion apps/browser/src/vault/fido2/content/page-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { Messenger } from "./messaging/messenger";
(function (globalContext) {
const shouldExecuteContentScript =
globalContext.document.contentType === "text/html" &&
globalContext.document.location.protocol === "https:";
(globalContext.document.location.protocol === "https:" ||
(globalContext.document.location.protocol === "http:" &&
globalContext.document.location.hostname === "localhost"));

if (!shouldExecuteContentScript) {
return;
Expand Down

0 comments on commit d0a116c

Please sign in to comment.