Skip to content

Commit 9bf7142

Browse files
authored
Minor fixes (#515)
* fix: added project link * fix: updated Escrow Balance Fetching * feat: Add send and receive functionality to WalletSheet, including destination validation and transaction submission. * feat: Add hackathon winner export functionality and update API export types. * feat: Request camera permission proactively in `DiditVerifyButton` to prevent iframe access issues and add `task.md` outlining hackathon improvements. * docs: Add hackathon improvement tasks and refactor Didit camera permission handling to patch the iframe's allow attribute.
1 parent 5cc3e08 commit 9bf7142

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

components/didit/DiditVerifyButton.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,23 @@ export function DiditVerifyButton({
8181
}
8282
};
8383

84+
// Patch the allow attribute on the iframe the SDK injects so the browser
85+
// presents the camera/mic permission prompt naturally inside the iframe.
86+
const observer = new MutationObserver(mutations => {
87+
for (const mutation of mutations) {
88+
for (const node of mutation.addedNodes) {
89+
if (node instanceof HTMLIFrameElement) {
90+
node.allow =
91+
'camera; microphone; fullscreen; autoplay; encrypted-media';
92+
observer.disconnect();
93+
}
94+
}
95+
}
96+
});
97+
observer.observe(document.body, { childList: true, subtree: true });
98+
8499
await sdk.startVerification({ url: verification_url });
100+
observer.disconnect();
85101
} catch (e) {
86102
const message =
87103
e instanceof Error ? e.message : 'Failed to start verification';

0 commit comments

Comments
 (0)