• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

excaliburjs / Excalibur / 6469 / 1
84%
main: 89%

Build:
Build:
LAST BUILD BRANCH: feat/plugin-system
DEFAULT BRANCH: main
Ran 28 Apr 2020 12:29PM UTC
Files 89
Run time 14s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Apr 2020 12:24PM UTC coverage: 82.683% (-0.05%) from 82.728%
6469.1

push

travis-ci

web-flow
fix(Keyboard): Fix accessing cross-origin frame exception (#1511)

Closes #1510

## Changes:

- Fix `Keyboard.init` throwing error when embedded in cross-origin iframe
- Add Keyboard story
- Fix Anchors stories so they show up again
- Fix Pointer stories and use `PointerScope.Canvas` in Storybook
- Disable Storybook shortcuts so they don't conflict with keyboard-enabled stories

Example of it working in iframe:

![image](https://user-images.githubusercontent.com/563819/80446222-e6d2a000-88db-11ea-8b9f-8ee3cbbd2250.png)


OK, so I discovered some things when testing this in jsfiddle (embed localhost <iframe>):

Keyboard events will not fire AT ALL on document when doing cross-origin iframes
Keyboard events WILL fire if a wrapping element around <canvas /> is used
Invoking Storybook's action helper is expensive and slows down FPS plus it also triggers cross-origin exceptions
Implementing an equivalent KeyboardScope like PointerScope is more involved because we'd need to re-parent the canvas and the initialization routine happens before the game is actually started, so the <canvas> element may be in a detached state (which is the case for Storybook, actually). I tried to do a this.on('initialize') within the initialization sequence but that never was emitted on Engine.

Pointer events avoid this issue entirely because canvas receives events fine. I also tried to do a "hack" using tabindex="1" as mentioned here but didn't get it to work.

Therefore, I will open a new issue to propose adding KeyboardScope so that people can fallback to listening to "canvas" key events if they want.

2045 of 3009 branches covered (67.96%)

6699 of 8102 relevant lines covered (82.68%)

16378.51 hits per line

Source Files on job 6469.1
  • Tree
  • List 0
  • Changed 33
  • Source Changed 1
  • Coverage Changed 33
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 5650
  • Travis Job 6469.1
  • b5134e72 on github
  • Prev Job for on master (#6457.1)
  • Next Job for on master (#6470.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc