Home / Firefox / How to Hack Website Using JavaScript Code

How to Hack Website Using JavaScript Code

You can modify any web site content using this JavaScript on your browser, but the changes are temporary. Basically, We are not hacking any website. Any changes done to any web site using this JavaScript are not going to affect the Websites. These changes are temporary. Imagine as if you are copying website content and editing in Microsoft word or any other editor, these changes appear/seen only to you. This might have disappointed few people who are really looking forward to hacking some web sites on the Internet. Anyway, you can fool your friends, relative or colleague using this JavaScript.

Hack Website Using JavaScript

Just copy and paste the below JavaScript code in the address bar of your web browser and hit Enter. You may notice that web page or web site will become editable just as a notepad/MS-Word document.

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

Besides of fooling people, this JavaScript feature comes handy if you want to print web page by modifying its content or creating fake screenshots. As you can see in the below image, we modified the content of Yahoo’s home Page using the JavaScript code.

JavaScript code to edit webpage

Note: Though the edits are temporary and disappears the moment you reload that page. So no need to worry when using this code, as you are not doing anything illegal here.

 

UPDATE:

Most of the web browsers today will not run the JavaScript directly from the address bar.

For Chrome & IE

When you copy and paste on Chrome & IE address bar, by default it will remove JavaScript name automatically. So simply add JavaScript name with colon in the start.

  • Copy and Paste the JavaScript code in address bar
  • Now press Home key, this will take you to the starting point of that code in address bar.
  • Type javascript: (don’t forget to add “:” colon right after “javascript” without any space), now just press Enter to execute.

For Firefox:

Post Firefox 6 updated; Firefox no longer supports running JavaScript on the address bar. Above trick used in Chrome and IE, will not work either. The only way you can run the JavaScript directly is using Bookmarklet or Firefox Scrachpad. Bookmark is simpler and easy, just add the code in your bookmark and run the bookmark.

  • Right-click on Firefox toolbar and choose New Bookmark. Add the above code manually in the location box of the bookmark and give any name for the bookmark as you wish.

or

  • Add Edit WebsiteDrag this link to your bookmarks toolbar.
  • Once this added to the bookmark toolbar, go to any web page and just click the Edit Website bookmark on toolbar and you should now be able to edit the webpage.

Alternatively, you can use Firefox console, Press Ctrl + Alt + K and paste the code and press Enter.

 

About Kroshan

Roshan Karkera a.k.a. k.roshan. Blogger by passion and software engineer by profession. He believes in sharing knowledge, which made him to start his own blog. He is very much keen & passionate about new technology & Science. If you'd like to connect with him, follow at Google plus or Twitter.
  • Max

    its working,its like we are editing notepad document.great thanks

  • Bryana

    This was awesome and i also tried to fool my friends and they really believe on that.dj your great.thanks

  • Your answer lifts the intleilgnece of the debate.