Skip to content

getLayoutMap() is unavailable in sub-context web applications due to privacy mitigations #38

@maymen1

Description

@maymen1

The privacy mitigations state:

As a first line of defense for the user, this specification requires that the API is only available from secure contexts and can only be called from the currently active top-level browsing context.

I'm a developer in the Excel Online application, working specifically on keyboard shortcuts.
Our application is hosted as a sub-context inside of an iframe element in the dome, where the top-level context can be many different endpoints - SharePoint, OneDrive, Teams, etc. That means the API is not available for us to use from inside the app code.

We're interested in using this API in order to handle Excel keyboard shortcuts for non-QWERTY keyboard layouts.

Currently we're using the KeyboardEvent.keyCode property, but there are some keys in non-QWERTY keyboard layouts that keyCode doesn't seem to handle correctly, and getLayoutMap() should resolve.
In addition to that, keyCode is deprecated, and there doesn't seem to be any alternative API to handle keyboard shortcuts for different layouts, other than getLayoutMap().

Should the keyCode property actually be removed one day - we believe all Office Online applications (PowerPoint, Word, OneNote, etc.) will require this or similar API to handle their keyboard shortcuts for different layouts.

We'd like to suggest two possible solutions -

  1. Soften the privacy mitigations so that we can use this API from the sub-context of our application.
  2. Create an additional API that only exposes the key value of the specific key pressed by the user, upon a key press event. This way the "fingerprint" is not so large for the user, since the API doesn't expose the entire keyboard layout, only the key that was pressed.

We'd be happy to start a discussion around this issue and find the best solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions