![]() |
#1 |
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Oct 2020
Device: MacBook, iPhone, Kindle Paperwhite
|
![]()
In the browser viewer, I have tried copying selection with a keyboard shortcut and with selection popup. Both can fail with a successful rate lower than 50%. It usually requires multiple clicks to copy text to the clipboard.
In Firefox's console, I got: Code:
document.execCommand(‘cut’/‘copy’) was denied because it was not called from inside a short running user-generated event handler. A direct alternative to this command is not provided, but the new Clipboard API seems to be the way to go. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,263
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
the new clipboard api only works over https and the viewer already uses it when execcommand fails with an exception, if it is available.
|
![]() |
![]() |
![]() |
#3 |
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Oct 2020
Device: MacBook, iPhone, Kindle Paperwhite
|
Huh, I am using https, but copying still fails quite often. Should have tried more browsers. Now it seems this only happens in Firefox. Will try to figure out what goes wrong.
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,263
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
probably when it fails firefox is failing to raise an exception.
|
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Oct 2020
Device: MacBook, iPhone, Kindle Paperwhite
|
Tried to look into the dev tool a bit more. So when an exception is raised (console shows the warning), copying will be successful. However, if console shows no warning, that is when copying becomes flaky. Sometimes it still works without a warning, sometimes it just does not. Interestingly, if I turn on Debugger, for those failed copying actions I get an error: "No permission to write to clipboard". Without Debugger, no error is shown. Again, this only happens in Firefox.
|
![]() |
![]() |
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,263
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sounds like a bug in firefox. Either the command should succedd or it should fail and firefox should raise an exception. If it is failing and not raising an exception that is a bug in firefox.
|
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Oct 2020
Device: MacBook, iPhone, Kindle Paperwhite
|
Yeah, I think it is. Just have to wait for Firefox to fix this bug.
|
![]() |
![]() |
![]() |
Tags |
browser, calibre, clipboard, viewer |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to let websites identify kobo browser as "mobile" instead of "PC"? | price | Kobo Reader | 10 | 03-06-2019 05:46 PM |
Browser Viewer: Request to hide <aside epub:type="noteref"> | nqk | Calibre | 7 | 07-11-2018 12:49 AM |
Calibre "Tags" copy to "shelves" | troll05 | Calibre | 5 | 06-21-2015 05:01 AM |
"Copy to Libary (delete after copy)" - Placement Suggestion | plib | Library Management | 8 | 07-17-2012 09:53 PM |
copy to clipboard in browser? | RAH | Nook Color & Nook Tablet | 1 | 04-28-2011 07:37 AM |