mirror of
https://github.com/bitwarden/browser
synced 2026-02-08 20:50:28 +00:00
Rename file
This commit is contained in:
32
apps/browser/src/tools/cxp/cxp-browser.service.ts
Normal file
32
apps/browser/src/tools/cxp/cxp-browser.service.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { filter } from "rxjs";
|
||||
|
||||
import { fromChromeEvent } from "../../platform/browser/from-chrome-event";
|
||||
|
||||
export class CXPBrowserService {
|
||||
init() {
|
||||
fromChromeEvent(chrome.runtime.onMessageExternal)
|
||||
.pipe(
|
||||
filter(([message]) => {
|
||||
return (
|
||||
typeof message === "object" &&
|
||||
typeof message.type === "string" &&
|
||||
message.type === "FIDO-CXP-PING"
|
||||
);
|
||||
}),
|
||||
)
|
||||
.subscribe(([message, sender, sendResponse]) => {
|
||||
const pongResponse = {
|
||||
type: "FIDO-CXP-PONG",
|
||||
supportedVersions: ["1.0"],
|
||||
exportRequest: {
|
||||
payload: "base64",
|
||||
importerUsername: "aaberg@bitwarden.com",
|
||||
importerUrl: "https://bitwarden.com/.well-known/cxp.json",
|
||||
requestSignature: "base64",
|
||||
},
|
||||
};
|
||||
|
||||
sendResponse(pongResponse);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user