diff --git a/nose/ping/index.tsx b/nose/ping/index.tsx
index bec88b3..3dc3351 100644
--- a/nose/ping/index.tsx
+++ b/nose/ping/index.tsx
@@ -1,2 +1,2 @@
export default () =>
-
pong pong - {Date.now()}
\ No newline at end of file
+ pongpong - {Date.now()}
\ No newline at end of file
diff --git a/public/browser-nav.js b/public/browser-nav.js
index ee9afc4..5b01da8 100644
--- a/public/browser-nav.js
+++ b/public/browser-nav.js
@@ -83,6 +83,20 @@
}
})
+ // Send all keydown events to parent
+ window.addEventListener('keydown', (e) => {
+ window.parent.postMessage({
+ type: 'KEYDOWN',
+ data: {
+ key: e.key,
+ ctrlKey: e.ctrlKey,
+ shiftKey: e.shiftKey,
+ altKey: e.altKey,
+ metaKey: e.metaKey
+ }
+ }, '*')
+ })
+
if (window.parent !== window) {
window.parent.postMessage({ type: 'NAV_READY' }, '*')
diff --git a/src/js/browser.ts b/src/js/browser.ts
index b243e22..2a507d6 100644
--- a/src/js/browser.ts
+++ b/src/js/browser.ts
@@ -59,6 +59,18 @@ function handleAppMessage(event: MessageEvent) {
case 'NAV_BLOCKED':
showNavigationError(data.url, data.reason)
break
+
+ case 'KEYDOWN':
+ const keyEvent = new KeyboardEvent('keydown', {
+ key: data.key,
+ ctrlKey: data.ctrlKey,
+ shiftKey: data.shiftKey,
+ altKey: data.altKey,
+ metaKey: data.metaKey,
+ bubbles: true
+ })
+ window.dispatchEvent(keyEvent)
+ break
}
}