Open Bug 167396 Opened 22 years ago Updated 2 years ago

Can't select text w/ mouse, and can't unselect after "Select All": RFE: pref to prevent JS blocking text selection

Categories

(Core :: DOM: Selection, enhancement)

enhancement

Tracking

()

People

(Reporter: bugs, Unassigned)

References

Details

Attachments

(1 file)

Steps to reproduce: 1. Load the URL 2. Try to select main body text w/ mouse - won't work 3. Use Edit->Select All to select all text 4. Try to unselect main body text w/ mouse - also won't work Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826
The site does this on purpose. function disableselect(e){ return false } function reEnable(){ return true } document.onselectstart=new Function ("return false") if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable }
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
OK, then how can I unselect the text? (Excepting disabling javascript, or reloading the page) To put it another way: Is the page broken, or mozilla has a bug, or is this behavior the perfect one?
Mozilla is doing what the page asked it to do. The page is doing something _I_ think is stupid, but I'm sure they have their reasons for it (or something). They're very definitely doing it on purpose, though....
And I almost forget: Is it also correct to have right click disabled on the page? (I'm going to file another bug for this, it's a serious problem about browser control)
Yes. The page does that on purpose too: document.oncontextmenu=new Function("return false") That bug is already filed; just search for "oncontextmenu"
Reopening to request a pref (with UI in Scripts & Windows) to ignore web pages' attempts to prevent the user from selecting text, or, rather, that the behavior is simply changed without adding yet another pref.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
There are legitimate uses for this functionality... eg if you want the user to be able to drag-drop chunks of text on the page without having little "selection trails" behind the mouse all the time...
Just as legitimate uses can be thought of for most of the functionalities we have prefs for in Scripts & Windows, but that doesn't make the abuse any less annoying.
Just realized you asked for a pref, not a default behavior. Sure, a pref I can see. ;)
Severity: major → enhancement
OS: Linux → All
Hardware: PC → All
Nasty stuff.
Blocks: Beonex, useragent
Workaround: use the Jesse's JavaScript Shell bookmarklet: http://www.squarefree.com/bookmarklets/webdevel.html and enter the following commands: document.onmousedown=new function(){return true;}; document.oncontextmenu=new function(){return true;}; I think web pages should never be allowed to do this...
Isn't this a dupe of bug 86193? I mean 86193 is about context menu and this one is about text selection, but I'm for making 86193 a general bug to not allow pages to prevent either mouse button to not work as desired. I don't understand why left and right mouse button both need an own bug.
URL no longer works. Attached testcase blocks selecting the text and also blocks the context menu as a control. The context menu can be re-enabled by setting dom.event.contextmenu.enabled to false. No such pref currently exists for onselectstart or onmousedown.
*** Bug 174795 has been marked as a duplicate of this bug. ***
a page where the original bug here can be seen is http://www.sas-gmbh.com/impressum.php from bug 250067
Summary: Can't select text w/ mouse, and can't unselect after "Select All" → Can't select text w/ mouse, and can't unselect after "Select All": RFE: pref to prevent JS blocking text selection
Assignee: mjudge → selection
Status: REOPENED → NEW
QA Contact: pmac
Assignee: selection → nobody
QA Contact: selection
I think I have experienced this problem, too; and the solutions was adding this part into file */chrome/userContent.css: * { -moz-user-select: text !important; user-select: text !important; }
See Also: → 1475156
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: