-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix(a11y): screen reader support for view only file preview #1495
fix(a11y): screen reader support for view only file preview #1495
Conversation
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.
Looks good to me!
15bd081
to
b0b2c2d
Compare
src/lib/viewers/doc/_docBase.scss
Outdated
@@ -304,6 +304,17 @@ $thumbnail-sidebar-width: 191px; // Extra pixel to account for sidebar border | |||
} | |||
} | |||
|
|||
.pdfViewer { | |||
&--viewOnly { |
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.
We typically want to spell out class names so they're easy to search for using our IDEs:
&.pdfViewer--viewOnly
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.
sure
i just updated the pr
7e2e7e1
to
d5082ec
Compare
This change adds support for screen readers and allow to disable copying content for view only PDF documents.
In order to simplify things the "view only" permission was implemented using CSS and JS , which should hopefully suffice.
The advantage of this approach, as opposed to e.g. disabling the textLayer completely, is first of all that it ensures that document is accessible through a screen reader. Secondly this also ensures that searching still works correctly even in copy-protected documents.
This kind of copy-protection is not very strong and is also relatively easy to create some workarounds. Hence a simple solution, targeting "normal"-users rather than "advanced"-users is hopefully deemed acceptable here.
Demo - https://cloud.box.com/s/h9dg4g7bwxorp60qvfvqgu5trjx9v5q6