-
Notifications
You must be signed in to change notification settings - Fork 117
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
Provide text-only copy option #51
Comments
Thanks for the report. I have fixed the Firefox issue (Firefox doesn't support module workers so I needed to load a polyfill and only supports the text part but not the binary part of the clipboard API). The Chrome issue is due to this outdated version (released a year ago) not yet supporting copying SVGs. Please update your Chrome version. |
No hope to make it work on older chrome just as text? |
Oh, so you’re stuck on 88? Curious to hear the background. But yes, text-only should work as a fallback in this case. Let me reopen this issue. |
@tomayac Hello! I am new to web-dev, and learn to use Async Clipboard API in copy web item to Microsoft-Offices.
I can new a Is there any suggestion for a elegent way to copy svg item cross platform( Web to Office)? thank you ! |
I just read a chrome official release feature blog about your team work on Async Clipboard: |
This is a problem that's fixed in Chrome 105, the current Canary version. Please try it there. |
Thank you
Correct, copying SVGs is still behind a flag.
The problem here is that Office looks at the clipboard and inspects the formats, and it finds three representations. You may prefer SVG, but Office prefers some other representation. The solution probably is to only copy SVG, and not the other representations.
In this case Office has no choice, so it deals with the SVG in the drag & drop operation, which it clearly is capable of. If you put just one representation, the SVG one, in the clipboard, it should work with pasting, too. |
@tomayac Thanks for you sparing time to guide me!
But, in case2, the encoded format is different and more complex. ( I just test copy event between Chrome and Office_Word): It may be that the Office follows its own internal blob file svg format specification, which make idea of directly copy svg between Office and Web unrealistic. |
For case 1, files are exposed via the For case 2, this may well be Office-specific behavior. Maybe worth finding someone from the Office team to talk to about that. |
Office uses the word-copy-svg-to-clipboard.mp4 |
Is there anything actionable for SVGcode to do left? |
For SVGcode, I'd suggest adding the For Office, I'm afraid it will take their team to improve it. @snianu Can you help me get in touch with the Office people? |
Can you try again now? (Make sure the service worker had time to reload the new app version, please.) It seems like I can't influence the order, but you're well aware via w3c/clipboard-apis#137. |
Yes, the main obstacle is the order. |
Ubuntu 20.04,
On "Copy SVG" click with default image (or any image):
The text was updated successfully, but these errors were encountered: