5

Some websites insist on ruining usability and accessibility by disabling the ability to select text on the page. Sites can do this via CSS or JavaScript (example page).

Is there some way that this can be disabled in Firefox so that the user can always select text no matter how the web page tries to disable it?

Disabling JavaScript globally is not a solution as it breaks many websites.

sleske
  • 23,525
WackGet
  • 797

2 Answers2

3

First, good question - I also notice this and it hugely annoys me.

The solution will depend on how the site disables text selection. As you write, this can be done using either CSS or JavaScript.

Disabled via CSS

The site most likely uses the CSS propert "user-select". user-select: none; will disable text selection.

To fix this, you would have to change the CSS styling the site uses. This can be done by running this small JavaScript snippet:

document.styleSheets[0].insertRule("* { user-select:text !important }", 1);

This will insert a new CSS rule that overrides the "user-select" setting of the page.

To run this: Either paste it into the JavaScript console of your browser's developer tools (and press enter), or use a userscript manager .

Disabled via JavaScript

This is probably trickier, because there are multiple ways of doing this. Most involve registering an event handler for mouse or selection events, but there are multiple events and multiple ways of registering them, so it's hard to give a general rule.

The pragmatic solution probably would be to temporarily disable JavaScript.

However, most sites I have seen that disable selection do it via CSS nowadays.

sleske
  • 23,525
0

To avoid typing the code into the console, you can use a bookmarklet. Create a bookmark with the the following code at the place of the URL:

javascript:(function(){javascript:document.styleSheets[0].insertRule("* { user-select:text !important }", 1);})();
Erik
  • 1