-
Couldn't load subscription status.
- Fork 1k
Allow JS to access clipboard #405
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
Conversation
|
@abemedia - can you review? I am really not sure why clang-format keeps on failing. |
|
Sure thing. Will do later today. |
|
If you run |
|
Have fixed the formatting. Think we're ready to merge |
|
Thankyou! |
|
No, thank you! ;) |
|
cool😉 |
| objc_msgSend(objc_msgSend(config, "preferences"_sel), | ||
| "setValue:forKey:"_sel, | ||
| objc_msgSend("NSNumber"_cls, "numberWithBool:"_sel, 1), | ||
| "javaScriptCanAccessClipboard"_str); | ||
| objc_msgSend(objc_msgSend(config, "preferences"_sel), | ||
| "setValue:forKey:"_sel, | ||
| objc_msgSend("NSNumber"_cls, "numberWithBool:"_sel, 1), | ||
| "DOMPasteAllowed"_str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are private APIs and may result in rejection from the Mac App Store, so we need to figure out another approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #425
|
I just noticed that on Gtk (Fedora Linux) middle-button click does a paste from the clipboard (i.e. CLIPBOARD), but it should do a paste from the current selection (i.e. PRIMARY). |
This is most likely the default in GTK since all this PR does is enable GTK's native clipboard support. |
|
"This is most likely the default in GTK since all this PR does is enable GTK's native clipboard support." Looks like you're right - using |
This PR enables JavaScript clipboard access for Linux, MacOS & Edge Chromium on Windows.
For Linux & macOS it enables both
document.execCommand("paste)&navigator.clipboard, however for Edge Chromium only the latter.I have not been able to find any info about enabling clipboard access for EdgeHTML so I assume it only works with a custom implementation. Since the Webview Runtime is dropping Q3 and will make the EdgeHTML integration obsolete it doesn't seem worth the effort though.