Find and Replace in Gmail

Can I find and replace a message I write in Gmail? The web pages are for reading purposes and therefore the developers did not make sure to include the "find and replace" feature in the browser code.queues

Websites, however, have evolved and now have not only static content. So if you write long emails or even want to find text in webpages, and you want to fix annoying misspellings, you need to fix them one by one.

Δεν μπορείτε να αντικαταστήσετε αυτόματα κάποια λέξη ή φράση σε ιστοσελίδα, χωρίς τη χρήση επεκτάσεων του προof browsing.

The following publication will show you a simple technique to help you search for and replace text on web pages using the built-in Chrome Developer Tool.

Open a page you want to edit.

While on the web page, press together the three keys Ctrl+Shift+J on on Windows or Cmd+Opt+J on Mac to open its window of Chrome developer tools.

Immediately after, give the following command to replace all appearances of the word iguru with iguru.gr.

document.body.innerHTML = document.body.innerHTML.replace (/ iguru / g, "iguru.gr")

You can use regular expressions for more complex substitutions. For example, if you want to replace all common misspellings, you could use some of these:

document.body.innerHTML.replace (/ (iguru | igurunews) / g, "iGuRu News") document.body.innerHTML.replace (/ ig [\ w] + ews / g, "iGuRu News")

The same technique can be used to format a page. For example, the next command will bold the word iguru on a page.

document.body.innerHTML.replace (/ iguru / g, "iguruΒ>")

Search and replace text in Gmail

Of course, your changes are not saved on the page you are editing when you close the browser tab.

Can you wonder why someone will search and replace on a website?

To explain the practicality of the above tweak, we'll give an example with Gmail.

You may have written a big email, but you find out before it is written that it contains misspellings.

To fix errors in bulk in Gmail, you can copy the email to , and perform search and replace. You will then need to paste the edited text back into Gmail. Or you can directly use Chrome's Dev tools.

In our previous example, we searched and replaced in document.body, which is addressed to websites. Let's see how it works in Gmail.

The first step is to find the word in the message you want to search & replace. Select the text you're interested in in the Gmail window, right-click and select Inspect Element. It will give you the ID of the DIV that contains the editable text. In our case it is “:1cv” for Gmail.

code gmail

Τώρα το μόνο που χρειάζεται να κάνετε είναι να τρέξετε την παρακάτω εντολή αντικατάστασης μέσα στο παράθυρο της ς για να αντικαταστήσει λέξη iguru με την λέξη igurunews παντού.

document.getElementById (': 1cv'). innerHTML = document.getElementById (': 1cv') innerHTML.replace (/ iguru / g, "igurunews");

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.100 registrants.

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).