New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support writing custom formats into clipboard #9243

Merged
merged 11 commits into from May 22, 2017

Conversation

Projects
None yet
3 participants
@seanchas116
Contributor

seanchas116 commented Apr 21, 2017

This adds APIs for writing custom formats into clipboard. (Thanks @poiru for electron/libchromiumcontent#278)

Fix #5698

@poiru

This comment has been minimized.

Member

poiru commented Apr 21, 2017

Unfortunately ScopedClipboardWriter only supports a single custom format at the moment (WriteData will overwrite the previous WriteData call). That said, supporting multiple custom formats is definitely valuable so maybe we should patch ScopedClipboardWriter further. It would also be great to support delayed clipboard data (see w3c/clipboard-apis#41).

@seanchas116

This comment has been minimized.

Contributor

seanchas116 commented Apr 21, 2017

It would also be great to support delayed clipboard data

I didn't know it's possible. It's super cool (but probably we need much more patches to Chromium)

Or should we move to native clipboard APIs instead of Chromium ones?

@seanchas116

This comment has been minimized.

Contributor

seanchas116 commented Apr 21, 2017

Maybe it would be an option to create and use a standalone Node module that manipulates clipboard (via native APIs) if you want detailed access to clipboard.

@seanchas116 seanchas116 changed the title from Support writing custom formats into clipboard to [WIP] Support writing custom formats into clipboard Apr 28, 2017

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Apr 28, 2017

Unfortunately ScopedClipboardWriter only supports a single custom format at the moment

Does this mean writeBuffer should be fine to add but taking a buffers array to write wouldn't work correctly?

Having writeBuffer seems worth it so should we just move forward with that one to start?

Or should we move to native clipboard APIs instead of Chromium ones?

I think sticking to Chromium APIs is a good plan for now, but it could eventually be removed completely from Electron if a great third-party node native module is available that is more robust.

@kevinsawicki kevinsawicki changed the title from [WIP] Support writing custom formats into clipboard to Support writing custom formats into clipboard May 22, 2017

@kevinsawicki kevinsawicki self-assigned this May 22, 2017

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented May 22, 2017

WriteData will overwrite the previous WriteData call

Reverted that in this branch to prevent confusion, just left clipboard.writeBuffer in there which is helpful to have, merging this 👍 🚢

Thanks @seanchas116 🎉

@kevinsawicki kevinsawicki merged commit 337f61a into electron:master May 22, 2017

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment