Sindar
Sindar

Reputation: 10879

No highlight on mouse Select?

I just need to find a solution to not authorized my user to highlight anything from my website on mouse select ?

Is this possible ?

Upvotes: 0

Views: 1480

Answers (5)

sam
sam

Reputation: 117

Regardless of why you want to disable the text select here is a little thing I found.
This page seems to know the answer. To stop people from viewing your source and copying the text from there you can always encrypt your HTML (beware of complications). An even better option would be to retrieve the content using ajax.

Now, none of the above with stop people from copying the content (if they want to do it, they will anyways), but you can make it harder so that only people skilled enough will be able to do it.

Upvotes: 0

Sindar
Sindar

Reputation: 10879

Thanks for your comments guys.

I've found a solution by using this :

-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
user-select: none;

Upvotes: 2

Town
Town

Reputation: 14906

There's no practical way (or reason) to do this, that I know of. There are scripts to disable text selection but anyone who really wants to get the text off your page will do. It's not complicated to simply disable Javascript or view the page source.

Basically, if you don't want people to be able to copy your content online, don't make it available online.

You could also go for the courtesy route: add a note to request that people copying your content for reuse provide a reference as to the source. That way the majority of your users who simply want to read the content and not copy it aren't adversely affected by ultimately ineffective counter-measures aimed at the minority.

Upvotes: 3

JohnP
JohnP

Reputation: 50029

I think you mean you don't want users to select your text?

First off, you shouldn't be doing this.

If you really really want to do this, you can

  1. Use web font replacement. A side effect of this is that you can't select fonts (not tested on all fonts, browsers)
  2. Look at this question : Prevent selecting & copying Talks about the same thing.

Remember, they can always just look at the source or just turn off JS

Upvotes: 1

Exelian
Exelian

Reputation: 5888

Not in a practical sense. If this is to prevent people from copying your text this isn't going to help. This is because the text is gonna be available to the browser, so the users will always be able to grab the text from the page, whether you want it or not. For example: you could still copy the data sent in the request done by the browser.

Upvotes: 1

Related Questions