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
Disable the "copy all text" feature when enablePermissions
is set (PR 16286 follow-up)
#16320
Disable the "copy all text" feature when enablePermissions
is set (PR 16286 follow-up)
#16320
Conversation
…PR 16286 follow-up) When permissions are enabled and the PDF document doesn't have the COPY-flag set, it shouldn't be possible for the user to trigger the "copy all text" feature.
e1adc90
to
6bfcc96
Compare
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.
LGTM.
Oh I missed the draft status. |
The GENERIC viewer can open more than one document, which I obviously forgot about initially; please check the updated patch. |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/2252a9f348c769e/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/5ff794d786c6f03/output.txt |
Do you plane to disable copy here too: |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/5ff794d786c6f03/output.txt Total script time: 4.16 mins
|
I don't believe that we need to, since we have CSS rules that prevent user-selection. Lines 196 to 199 in 3e292dc
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/2252a9f348c769e/output.txt Total script time: 22.53 mins
|
After having thinking about that, I think it could be useful to be able to select the text (for example when the user wants to show something to someone else) even if the copy is disabled (I personally already have been in such a situation and it was a bit painful). So I'd inclined to remove the CSS rule and disable the copy in the copy listener. Wdyt ? |
Sure, we could implement it like that without too much trouble I think; I'll submit a patch for this later.
In Adobe Reader there's an additional sidebar-view in protected documents, but given that we ignore permissions by default that feels like a slightly too "heavy" solution in the PDF.js viewer. Your idea about an additional toolbarButton with a tooltip sounds simpler, although we'd probably need a couple of new l10n-strings for that. |
When permissions are enabled and the PDF document doesn't have the COPY-flag set, it shouldn't be possible for the user to trigger the "copy all text" feature.