Hi,
I'd like to allow for a section of text to be selected (to allow for inline comments), but disallow it from being copied.
This page illustrates perfectly what I want to do: https://codepen.io/herrberk/pen/yJJgJe
Is there a way to implement that page's code for 'select but not copy' in confluence's CSS? I don't need the alert part, just the disable copy part.
<p class oncopy="return false;" oncut="return false;" oncontextmenu="window.alert('Nice try! Even Ctrl+C or Ctrl+X will not work!');return false;"><i>You can select but can not copy me ;)</i></p>
I am with @Marty , I am curious about your use model.
If you are trying to stop unscrupulous copying, it would probably be done by someone who is fully aware of the workaround. For example, with inspecting a page, you can just turn off those CSS rules. Or I can pay someone else to just quickly transcribe the content. If it is online, it can be copied.
If you have the space set to view-only for all users except admin, then you have done as much as you can to protect your content (plus a site-wide copyright statement). But at some point, you have to trust your users. Otherwise, you need to distribute your documentation via secured PDFs only, each one serial numbered, tracked and distributed under NDA. But even that will not protect you from the unscrupulous.
Hi Bill,
Please see my response to Martyn above.
I realize that there will always be a way to copy the text if someone is determined enough, but I'd simply like to make it slightly more inconvenient to discourage certain behaviors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried beatings? ;-)
Yes, weaning people of off Word is really hard. The issue you have is trying to disable the copy function but still allow the inline commenting (which requires the ability to highlight). So that means you cant use the CSS hack you showed to just disable the ability to highlght/select. You need to be able to implement the events:
oncopy="return false;" oncut="return false;
Which would need to be implemented on the main content container of the page:
<div id="main-content" class="wiki-content">
</div>
And that means you need to modify page layout. Which now is easier to do than before. Go to the admin console, Layouts under Look and Feel.
customizing-site-and-space-layouts
Use with caution, actual mileage may vary.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cheers Bill, thanks for that.
Unfortunately I don't have system admin privileges (I don't have the 'general config' -> 'layouts' option.
Sounds like layout editing would be the only way to accomplish this? Is there anything you can think of that may be available in the "space tools" that would solve for this as well?
Otherwise I'll just need to find and bug the system admin :|
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, this is an admin only feature due to the far-reaching implications of changing these templates.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I'll have to bug them then. Thanks for the help with this one :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello, @Bill Bailey i have made changes as you were list above in page layout. but i want to restrict copy for specific "space " only ..how to do that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bob,
I am not from the Confluence team, but I will try to help.
In general trying to prevent people from copying content from a web page will not be 100% airtight. People can take screenshots. Or take photos with their phones. Or open up the developer tools, inspect an element, and copy the content that way.
The code you're trying to add to the page might fool some users but not all.
I wondered if you could share a little more about why you're trying to prevent users from copying some content and perhaps I can suggest a different way to use Confluence to achieve your goals?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Martyn,
Thanks for the response.
I understand that nothing is 100% secure and I'm not worried about this. I only want to put in road blocks and make the process inconvenient.
My use case is that we use confluence to review team documents. Some members outside of my team will copy and paste the contents of the page into a word document and send their review comments that way rather than commenting on the page directly (even though of course we've asked them not to). I'd like to discourage that behavior, so making the text selectable to allow for in-line commenting but not copyable should be sufficient.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh that makes sense. That does sound frustrating!
Sorry to hear that. Let's see if the community can help you with a small CSS trick then.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.