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

excaliburjs / Excalibur / 6469
84%
main: 89%

Build:
Build:
LAST BUILD BRANCH: feat/plugin-system
DEFAULT BRANCH: main
Ran 28 Apr 2020 12:29PM UTC
Jobs 1
Files 89
Run time 17s
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

pending completion
6469

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

Jobs
ID Job ID Ran Files Coverage
1 6469.1 28 Apr 2020 12:29PM UTC 0
82.68
Travis Job 6469.1
Source Files on build 6469
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6469
  • b5134e72 on github
  • Prev Build on master (#6457)
  • Next Build on master (#6470)
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