Find and replace text quickly in Chrome without any extension

Chrome is a powerful browser having its own javascript console to test javascript right inside your browser. But, you can use chrome browser as a find and replace text tool. It works both online and offline. So, you do not need to install any third party software and extension or apps for doing this. Just read on to know how to do this.

Step 1 -Open chrome browser.



Step 2 – Paste the following code below on the address bar of your Chrome browser. This code will make your chrome browser a notepad editor.

data:text/html, <html contenteditable>

Step 3 – Now, copy and paste the on which you want to work.

Step 4 – Press CTRL + Shift + J to open console. (Mac user should press CMD + OPT + J)

Step 5 –  Now, paste the code given below in the console. Just change the text to be replaced and text with which you want to replace from your texts. Hit enter

document.body.innerHTML = document.body.innerHTML.replace(/Text to be replaced/g, "Text with which you want to replace")

Step 6 – For case insensitive replacement use this code given below. Hit enter

document.body.innerHTML = document.body.innerHTML.replace(/Text to be replaced/gi, "Text with which you want to replace")

Thats it. Now, you know a method to use chrome as a find and replace text tool.

Find Replace Text Chrome



 

Note: – You can also open console if you are browsing inside any web page and use the code to find and replace text on any website. The code can be used to create pranks by changing website text and even twitter tweets. You can take the screenshots of the web page to shock your friend.