X
Tippen Sie hierhin, um die Version dieser Website für Mobilgeräte aufzurufen.

Hilfeforum

Force firefox to use spellcheck with a certain site

Veröffentlicht

My FF spellcheck works just fine, for almost all sites. But there is one site in particular (requires a login; it is a Moodle learning management system online class page) that must tell my browser not to use spellcheck on it.

Is there a script or about:config command I can use, to get FF to ignore this request, and give me spellcheck?

My FF spellcheck works just fine, for almost all sites. But there is one site in particular (requires a login; it is a Moodle learning management system online class page) that must tell my browser not to use spellcheck on it. Is there a script or about:config command I can use, to get FF to ignore this request, and give me spellcheck?

Mehr Details zum System

Anwendung

  • User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0

Weitere Informationen

Veröffentlicht

Fragesteller

cor-el said

Does either of these JavaScript codes work in the Web Console or as a bookmarklet?
javascript:void(document.querySelector(".mceContentBody").setAttribute("spellcheck", "true"));
javascript:void(document.querySelector("[contenteditable=\"true\"]").setAttribute("spellcheck", "true"));

I don't know how to make a bookmarklet.

As far as the console goes--I opened the inspector, clicked on the Console button, and then pasted both bits of code below. Both times, I got an error message: TypeError: document.querySelector(...) is null

I don't know if I'm doing something wrong, or not.

''cor-el [[#answer-881283|said]]'' <blockquote> Does either of these JavaScript codes work in the Web Console or as a bookmarklet? <pre><nowiki>javascript:void(document.querySelector(".mceContentBody").setAttribute("spellcheck", "true"));</nowiki></pre> <pre><nowiki>javascript:void(document.querySelector("[contenteditable=\"true\"]").setAttribute("spellcheck", "true"));</nowiki></pre> </blockquote> I don't know how to make a bookmarklet. As far as the console goes--I opened the inspector, clicked on the Console button, and then pasted both bits of code below. Both times, I got an error message: TypeError: document.querySelector(...) is null I don't know if I'm doing something wrong, or not.
cor-el
  • Top 10 Contributor
  • Moderator
17341 Lösungen 156761 Antworten
Veröffentlicht

It is possible that the actual editor is in a iframe.

What is the unique selector of the text edit area (this is one of the items in the right-click context menu)?

It is possible that the actual editor is in a iframe. What is the unique selector of the text edit area (this is one of the items in the right-click context menu)?
Veröffentlicht

Fragesteller

cor-el said

It is possible that the actual editor is in a iframe. What is the unique selector of the text edit area (this is one of the items in the right-click context menu)?

I searched in the INspector for uniqueSelector and found nothing. It gave me no results---if this is what you wanted me to do. Sorry a bit over my head. When I simply right-clicked, either inside the text area or outside of it, I found nothing like "unique selector" to choose.

''cor-el [[#answer-881294|said]]'' <blockquote> It is possible that the actual editor is in a iframe. What is the unique selector of the text edit area (this is one of the items in the right-click context menu)? </blockquote> I searched in the INspector for uniqueSelector and found nothing. It gave me no results---if this is what you wanted me to do. Sorry a bit over my head. When I simply right-clicked, either inside the text area or outside of it, I found nothing like "unique selector" to choose.
cor-el
  • Top 10 Contributor
  • Moderator
17341 Lösungen 156761 Antworten
Veröffentlicht

You find this item in the right-click context menu of an element in the left pane of the Inspector just a few lines below "Edit As HTML".

  • "Edit As HTML"
  • "Copy Inner HTML"
  • "Copy Outer HTML"
  • "Copy Unique Selector"
You find this item in the right-click context menu of an element in the left pane of the Inspector just a few lines below "Edit As HTML". *"Edit As HTML" *"Copy Inner HTML" *"Copy Outer HTML" *"Copy Unique Selector"
Veröffentlicht

Fragesteller

I think I know what you wanted me to do. After clicking in the text field, I looked down to the Inspector, adn right clicked on the line of text that was selected (had a blue bar).

Now there was no "Copy Unique selector" option right under Edit as HTML. I am on FF nightly (don't know if that has anythign to do with it). What I saw was a Copy option, and an arrow that gave one option as CSS Selector. I clicked on that. I then pasted what you see below:

#fitem_id_subject

Is this the information you were looking for?

I think I know what you wanted me to do. After clicking in the text field, I looked down to the Inspector, adn right clicked on the line of text that was selected (had a blue bar). Now there was no "Copy Unique selector" option right under Edit as HTML. I am on FF nightly (don't know if that has anythign to do with it). What I saw was a Copy option, and an arrow that gave one option as CSS Selector. I clicked on that. I then pasted what you see below: <pre><nowiki>#fitem_id_subject</nowiki></pre> Is this the information you were looking for?

Geändert am von cor-el

cor-el
  • Top 10 Contributor
  • Moderator
17341 Lösungen 156761 Antworten
Veröffentlicht

Yes, that is to one in the current Nightly build: Copy > CSS Selector

You can use such a selector in querySelector()

elm=document.querySelector("#fitem_id_subject");

If that element has the spellcheck attribute then this JavaScript code should set it to true:

javascript:(function(){elm=document.querySelector("#fitem_id_subject");elm.setAttribute("spellcheck", "true"));})()

A bookmarklet is a bookmark that has JavaScript code instead of the URL of a website in its location field.

If you know some basic JavaScript then you can make all kind of changes to a web page.

Yes, that is to one in the current Nightly build: Copy > CSS Selector You can use such a selector in querySelector() elm=document.querySelector("#fitem_id_subject"); If that element has the spellcheck attribute then this JavaScript code should set it to true: <pre><nowiki>javascript:(function(){elm=document.querySelector("#fitem_id_subject");elm.setAttribute("spellcheck", "true"));})() </nowiki></pre> ----- A bookmarklet is a bookmark that has JavaScript code instead of the URL of a website in its location field. *https://en.wikipedia.org/wiki/Bookmarklet *https://en.wikipedia.org/wiki/Data:_URI_scheme If you know some basic JavaScript then you can make all kind of changes to a web page. *https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector *https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
Veröffentlicht

Fragesteller

I found the location of that fitem ID. It didn't have anything about spellcheck. I copies the "OuterHTML" and this is what it had:

<label for="id_subject">SubjectRequired field </label>
<input size="48" name="subject" value="" onblur="validate_mod_forum_post_form_subject(this)" onchange="validate_mod_forum_post_form_subject(this)" id="id_subject" type="text">

At any rate, I did make a bookmarklet out of that code anyways, but it didn't work--on text I had already typed in, or on text that I typed after I hit that bookmarklet.

I found the location of that fitem ID. It didn't have anything about spellcheck. I copies the "OuterHTML" and this is what it had: <div id="fitem_id_subject" class="fitem required fitem_ftext"><div class="fitemtitle"><label for="id_subject">Subject<img class="req" title="Required field" alt="Required field" src="http://moodle.bcconline.us/theme/image.php?theme=standard&amp;image=req&amp;rev=281"> </label></div><div class="felement ftext"><input size="48" name="subject" value="" onblur="validate_mod_forum_post_form_subject(this)" onchange="validate_mod_forum_post_form_subject(this)" id="id_subject" type="text"></div></div> At any rate, I did make a bookmarklet out of that code anyways, but it didn't work--on text I had already typed in, or on text that I typed after I hit that bookmarklet.
cor-el
  • Top 10 Contributor
  • Moderator
17341 Lösungen 156761 Antworten
Veröffentlicht

You need to find the selector of the text editor area that has the spellcheck attribute if you want to modify this attribute and use that as parameter in the document.querySelector() function.

Firefox doesn't enable the spell check on single line input fields by default. You need to set layout.spellcheckDefault to 2 on the about:config page. See also:

You need to find the selector of the text editor area that has the spellcheck attribute if you want to modify this attribute and use that as parameter in the document.querySelector() function. Firefox doesn't enable the spell check on single line input fields by default. You need to set layout.spellcheckDefault to 2 on the <b>about:config</b> page. See also: *http://kb.mozillazine.org/layout.spellcheckDefault