Skip to content

Support CopyAsImage in iframe #5383

@YuxinZhaozyx

Description

@YuxinZhaozyx
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Is your feature request related to a problem? Please describe.
I embed the draw.io editor in an iframe, but "Copy As Image" is not shown in the right-click menu.

Describe the solution you'd like
I have checked the source code. The menu item "Copy As Image" is set to invisible when Editor.enableNativeClipboard is false, while Editor.enableNativeClipboard is set to false in iframe (Editor.js):

/**
 * Specifies if the native clipboard is enabled. Blocked in iframes for possible sandbox attribute.
 * LATER: Check if actually blocked.
 */
Editor.enableNativeClipboard = window == window.top && navigator.clipboard != null &&
	navigator.clipboard.read != null;

The comments of this line indicate that the native clipboard should not be blocked in iframe if sandbox attribute is unset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions