Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 110441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:13:39+00:00 2026-05-11T02:13:39+00:00

I need to prevent user from selecting text (select all or select a portion

  • 0

I need to prevent user from selecting text (select all or select a portion of text) in the browser Mozilla Firefox, using java script. I have done this using Internet Explorer, but it seems doesn’t work with Mozilla.

Any hints? URL? Sample?

TIA.

EDIT:

Actually, this ridiculous problem was requested by our client. And yes, we have explained them that there are thousand other ways to get the text. But they answer that they know about that, they just want to prevent for amateur user to do that.

I have done some googling and find similar problem with the solution here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:13:39+00:00Added an answer on May 11, 2026 at 2:13 am

    There is no way to fully protect content you publish, short of DRM schemes which are not widespread enough to be useful for a website. But to prevent simple copy-and-paste there are several approaches, each of which is very annoying to your users.

    A simple way would be to cover the text with another element, such as a DIV, using CSS positioning. This would mean that when the user tries to click on the DIV to select the text there would be no text to select. Should work in any browser that supports CSS and in browsers that don’t it will probably be completely invisible. Clicking on the page and hitting CTRL+A (or some other shortcut key) may select the text anyway, and it may be impossible to block all key and mouse events that can get at the text. But this DIV ‘lid’ approach is at least unobtrusive and easy to generalize. However, this is trivially defeated by looking at the HTML source. It is less trivially defeated by turning off CSS (easy to do in Firefox, and many Firefox users are sophisticated enough to do it).

    A more robust approach would be to render the text as a graphic, either using a regular image file or something like a PDF. However graphics can be OCR’ed. There are free tools for this.

    Finally you could put your text in a Flash or Java applet, which would download the text from the server. Someone could steal your applet but would have difficulty making it talk to your webserver due to the same-origin security policy (note: this can also be worked around). This approach is not that much better than the PDF approach except that it makes it harder to grab entire documents, because the applet will only display a portion of the document at a time. To defeat this using OCR the attacker has to take screen-captures. Or they could reverse-engineer your applet and make a new applet (or even a regular program) which downloads all the content from your server.

    All those approaches are only of the most basic use and I suspect you’ll find that they don’t help at all. You’d probably get more return on investment building useful features rather than this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 116k
  • Answers 116k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer not sure it has a name; more formally stated, it… May 11, 2026 at 10:36 pm
  • Editorial Team
    Editorial Team added an answer and i took it for granted that this cant be… May 11, 2026 at 10:36 pm
  • Editorial Team
    Editorial Team added an answer public static IEnumerable<DataRow> EnumerateRows(this DataTable table) { foreach (var row… May 11, 2026 at 10:36 pm

Related Questions

This is a GUI application (actually MFC). I need a command window with the
I am developing an application for the Android platform which contains 1000+ image filters
I have a WinForms application with a view where the user selects a single
I need to prevent a document from being saved / saved as (say from

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.