Discussions » Creation Requests

Disable spellchecking on login and search boxes

§
Posted: 2017-06-14

Disable spellchecking on login and search boxes

I'd like to disable spellchecking on some text boxes like login or search ones in Firefox. The most annoying are the login boxes. Firefox detects them as login boxes so maybe there's a global code for them.

I don't know about search boxes, but maybe using classes or id for typical ones it could be done? Like search, search-box, searchText, searchInput, searchWrapper or attribute placeholder="Search".

I'd like to exclude also text boxes where codes (like for user scripts) are typed. TEXTAREA element's name attributes are ended with [code]. Could someone give me any idea to do it?

§
Posted: 2017-07-04

No one can help me with it?

wOxxOmMod
§
Posted: 2017-07-07

Well, here's a very simple example that disables spellchecker on all input and textarea by default. The state can be toggled for currently focused element via Ctrl-Shift-Alt-S and it's not remembered on next page open.

// ==UserScript==
// @name    Unsepllchekcer
// @include *
// @require https://greasyfork.org/scripts/12228/code/setMutationHandler.js
// ==/UserScript==

setMutationHandler({
  processExisting: true,
  selector: 'input, textarea',
  handler: elements => elements.forEach(el => {
    el.spellcheck = false;
  }),
});

window.addEventListener('keydown', function(e) {
  if (e.which == 83 && e.ctrlKey && e.altKey && e.shiftKey && 'spellcheck' in e.target) {
    e.target.spellcheck = !e.target.spellcheck;
    e.target.blur();
    e.target.focus();
  }
});
§
Posted: 2017-07-08

I'm bad at scripting, so I don't have any idea how to adjust it for my needs.

§
Posted: 2017-07-22

go to about:config and search for layout.spellcheckDefault and change the value to 1 you porbably have it in 2 that's why is checking searchboxes and stuff like that.

§
Posted: 2017-08-27

@Roxz
Why I would do that? I've changed it myself to have spellchecking on single-line boxes, cuz it was very annoying to have to enable it there everytime. Read the first post again if you didn't understand what I need.

Post reply

Sign in to post a reply.