Search engine optimisation from Blogstorm

Cut and paste one line of code to make any website editable

by Patrick Altoft on July 7, 2008

Have you ever wanted to edit the web pages of another website? This simple line of code makes it possible.

Of course you can’t actually edit the actual web page but you can edit the page as you see it on your screen.

This is one of the ways scammers create fake screenshots, fake Adsense & affiliate earnings and even fake Paypal transactions.

All you need to do is visit the site you want to edit, paste the code below into your web browser address bar (tested in Firefox & IE7) and hit the Enter button.
Then simply select a portion of text on the page and start editing.

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

You can get our blog posts delivered for free by email every day - simply add your email address to the box below or alternatively grab the RSS feed.

Read some similar posts

Published in: Coding delicious | digg | reddit | StumbleUpon | Google Bookmarks | Sphinn

{ 15 trackbacks }

Edit Any Webpage Directly From Your Browser | Hackosis
07.07.08 at 2:09 pm
Misbehaving Monkey » Blog Archive » Cut and paste one line of code to make any website editable
07.07.08 at 7:40 pm
Fakey fakey fake fake? | A Buck A Night
07.07.08 at 8:39 pm
Editing your Earnings Pages - WickedFire - Affiliate Marketing Forum - Internet Marketing Webmaster SEO Forum
07.07.08 at 8:47 pm
JASON PRIESTAS » Website Editing with a Little JS
07.07.08 at 9:00 pm
Linkblog - June 28th to July 7th | wibbler.com
07.07.08 at 10:01 pm
How to make a website editable? « 8-bits of Coffee
07.07.08 at 10:42 pm
links for 2008-07-08 « Talkabout
07.08.08 at 4:56 am
gfrast / Daily hand picked web links - mixed with a shot of reality.
07.08.08 at 8:01 am
Mulling It Over
07.08.08 at 6:44 pm
Linkblog - August 2nd | wibbler.com
08.03.08 at 9:00 am
Thursday Links Roundup #7 - Putting Blogs First
08.15.08 at 6:38 am
tasteslikeangry » Moar link dump. Weirder this time.
08.20.08 at 6:29 am
Edit any website with a line of Javascript code « Athleone’s Weblog
08.31.08 at 12:08 pm
Reallyla.me » Blog Archive » Links - Oct. 1, 2008
10.01.08 at 11:58 pm

{ 61 comments… read them below or add one }

1 Silki 07/07/2008 at 10:39 am

Now, I understand, how the affiliate marketers, and the authors of the million dollar secret formula actually operate.
Thanks.

2 Rob Lewis 07/07/2008 at 12:22 pm

That’s quite scary - I knew it was possible by altering the HTML and resaving somewhere, or by doing some Photoshopping, but that’s just much simpler.

3 Stuart Smith 07/07/2008 at 1:48 pm

Like Rob I knew it could done but never realised how quick it could be. I suppose this is just one of a number of ways it could be done though. Guessing the lesson here is always beware what links you are sent?

4 visitor 07/07/2008 at 4:54 pm

You are aware that the editong happens only inside the momory of your browser??? You can edit what you want but you will not be able to save your “Work”

So it is just a funny joke that will not harm your pages in any way.

5 Patrick Altoft 07/07/2008 at 4:56 pm

Yes I’m aware of that. Pretty cool though.

6 Tibi Puiu 07/07/2008 at 7:01 pm

Hehe, awesome hack, Patrick. I’m not too sure about disclosing this little secret right here, who knows what scams might occur if it falls in the wrong hands :<

7 moron@moron.com 07/07/2008 at 7:16 pm

Seriously…you guys are morons. Like you said, this does NOTHING WITH THE HOSTED VERSION.

it’s just a few seconds easier than saving and modifying the source locally.

8 bofh 07/07/2008 at 7:22 pm

Wow. There is one thing I really love about this — with firefox, you can save the edited page.

I’ve always wanted a decent editor that could just work w/ templates.

Seriously — got a tipjar? :-)

9 bofh 07/07/2008 at 7:25 pm

I should also mention, it will save the various Editibles into the final document, so be sure to remove before upload if you do this :)

10 Matthew 07/07/2008 at 7:35 pm

This works in Safari as well!

11 Sphurthy 07/07/2008 at 7:37 pm

This is very cool and scary

12 prags 07/07/2008 at 7:40 pm

Fair enuff, but wats the point if i cant save my designs????

13 nobody 07/07/2008 at 7:47 pm

This should be handy for note taking (other than using some other firefox extensions). I just made this code a bookmarklet. Now for writing papers and such, I can find a web page, click my bookmarklet, make notes, then save the web page w/ notes. Much faster than editing source, and better formatting than copying to Word/notepad/whatever, and adding notes there. If someone has a better way of taking notes, point me to the extension.

14 hmm 07/07/2008 at 8:10 pm

so then how would you edit a website with a blank index.html tag so you can edit the files in that same folder!?

15 mgroves 07/07/2008 at 8:19 pm

Works in Opera too. Neat trick!

16 2oonhead 07/07/2008 at 8:40 pm

@ visitor, not true.

@ prags, just make the changes you want then “Save Page As…..” under “File” in Firefox. This does not change the way the page is served up from the internet, but you can save a changed version of it to your desktop or something.

17 Mac Tips 07/07/2008 at 8:59 pm

You can also do this within Firebug. Very cool, and you don’t need a plugin.

18 evrim 07/07/2008 at 9:20 pm

Actually the ‘title’ is possible:) Just put a simple script and make your site editable in 7 minutes.

Users Guide ScreenCast:
http://www.core.gen.tr/videos/asli9.swf

Desginers Guide ScreenCast:
http://www.core.gen.tr/videos/asli101.swf

Product Info:
http://www.core.gen.tr/#coretal

19 Chris Architect 07/07/2008 at 9:37 pm

That’s insane! very c00l for developers to mess around with ideas, layouts ….

20 Luke 07/07/2008 at 9:38 pm

I think that you may have missed the point that Patrick is trying to make, here - it’s not about editing the hosted version at all. It’s about being able to easily forge things like screenshots, and go “look at this! Here’s a screenshot of an actual Adsense page, with over $10m in earnings!”. It doesn’t matter whether the changes get saved or not - it’s simply about being able to create fake screenshots easier.

21 SoLinkable 07/07/2008 at 9:45 pm

Holy hell this is insane. I had no clue it was this easy to do…

22 noptical 07/07/2008 at 9:47 pm

The dangers don’t lie in screenshots, they lie with people who edit hidden form values to change item prices, and people who edit AJAX for malicious purposes.

Sure the changes aren’t saved on the server, but that doesn’t mean the page stops being able to interact with it.

23 Jeff 07/07/2008 at 9:50 pm

While trying it on various sites in my favorites list, found that funnyordie.com displays only a login form after entering this javascript url in the address bar. All images and text from the page are hidden.

24 Durkin 07/07/2008 at 10:03 pm

this is madness! Its actually quite fun to play with though :D

25 CaptainObvious 07/07/2008 at 10:51 pm

Or you could just use Firebug and it’s a lot easier, cleaner, and faster…

26 Tipper 07/07/2008 at 11:40 pm

In Firefox, once you type the command in the address bar and hit enter, grab the command and drop it into the bookmarks toolbar, then right click, properties, change name to “Edit” and there you have it, a nice little button handy for when you need it.

27 moron@moron.com 08/07/2008 at 12:01 am

Why wouldn’t they just download the page and edit it. There are tons of scripts that already do this. There are tons of editors that do this for you online too (like FCK Editor).

I feel like I’ve jumped back in time to 2001 when this was new.

28 Zibby 08/07/2008 at 12:40 am

That’s pretty wild stuff. It definitely explains a lot of the clickbank “earnings” I’ve seen from a lot of folks. ;)

29 lefty.crupps 08/07/2008 at 1:17 am

Is there any /other/ line of code which can allow me to save and use a page as an offline web application?

30 d00d 08/07/2008 at 1:22 am

Any way to add this the the head of an HTML file to make it permanent and automatic to visitors?

31 Larry 08/07/2008 at 4:58 am

Works in Opera 9.50

32 liquidpele 08/07/2008 at 5:40 am

Ummm… have you guys never heard of the “firebug” firefox plugin?
It lets you edit the DOM live, even the dynamically generated stuff.

In other words, there are actual tools for this - most of them are for debugging your own web development. Thinking this kind of thing is important is like thinking it’s important that someone knows that my username bought a hard drive on ebay last year. Ooooh, scary!

33 redivide 08/07/2008 at 6:05 am

OMGWTF, you people ain’t heard of Firebug yet?

34 ralph natterbough 08/07/2008 at 8:39 am

hey, 2001 called and wants its leet hax back!

35 Team Nirvana 08/07/2008 at 8:42 am

This is quite scary.

Donno how much scam had already been done and how many affiliate marketers have laughed all their way to the banks.

36 S 08/07/2008 at 9:40 am

Phew! I used to do this using FF and FireBug. But this is much cooler!

37 Peter Stuifzand 08/07/2008 at 11:19 am

Why would you include item prices in your hidden values. There is no need for that and is bad design. Item prices should be stored server-side (a database for example).

If your webshop needs you to have item prices in the hidden values, then you should try another webshop.

38 Vineetgupta 08/07/2008 at 11:39 am

You do realise that everyone is going to test it on your page? ;-)

Great trick!

39 ben 08/07/2008 at 12:01 pm

haha nice one.

40 Dean 08/07/2008 at 12:47 pm

did you even read the post?

“Of course you can’t actually edit the actual web page but you can edit the page as you see it on your screen.”

41 ODP 08/07/2008 at 1:04 pm

This is also a standard feature of Opera.
To edit the source:
1. View > Source (Or Ctrl+U)
2. Make the edits in Opera’s color-coded Source Editor
3. Click “Apply Changes”

Bam, site’s edited.
Also, with the developer tools you can view all of the scripts, DOM, and all of the errors that show up in the code.
Tools > Advanced > Developer Tools

It’s cool to see that you can do this in IE, though.

42 otacon 08/07/2008 at 1:50 pm

Yesterday a friend of mine came to meet me at my office.
I last saw him some years ago at high school.
He talked for long about earnings he was raising through adsense. Sitting at my desk, using my firefox, he showed me (after a short phone call I had to answer) his huge adsense earnings on the adsense profile.
But after reloading the page, it revealed as a fake.

I think this is the kind of story this link is about.
Many would trust what they read on *theyr* screen, not wondering about hitting F5 to test it out.
And many more can, with a bookmark, fake screenshots without learning html or at all.
btw, I never trust screenshots, do you?

43 phetrs 08/07/2008 at 4:32 pm

Does it illegal for this work?
I am new comer know not much about that.

44 phetrs 08/07/2008 at 4:34 pm

how does it work?

45 Harry Roberts 08/07/2008 at 8:28 pm

You can do this with Firebug… And more. Kudos anyway, it works in IE at least.

46 Kamal 08/07/2008 at 8:44 pm

Freakin awesome now i can edit microsoft,ibm,sony website and take screenshots.Thats it!

47 ext 09/07/2008 at 12:01 am

Very cool

48 turnthebeataround 09/07/2008 at 5:27 pm

I just tested it out on this page using Firefox 3. Amazing. (Maybe I can trick my moron inexperienced kid brother into thinking I’m magic after I hide the URL bar…)

49 Lars 11/07/2008 at 8:36 am

Also works in Safari on a Mac

50 Wordpress SEO 12/07/2008 at 9:59 am

Omniweb has had this feature for years. Very helpful when troubleshooting code.

The anecdotal story about fake adsense earnings is hilarious. I can’t quite believe it though.

51 paresh 13/07/2008 at 10:40 am

good, useful article.

52 oMan 13/07/2008 at 11:15 pm

Have you ever wanted to edit the web pages of another website? No, just my sites.

53 Enamul 17/07/2008 at 3:15 pm

Thanks for sharing this simple yet powerful javascript code.

54 Sueblimely 22/07/2008 at 2:15 am

I have been using the edit features of the Web Developer toolbar for what seems like years to do this while testing out html and CSS. The Scrapbook extension for Firefox is nifty too. It allows you to download a local copy of a webpage but you can erase the parts of a page you don’t want first- e.g. you just want to save the text and delete sidebars, footers, images etc…

55 montsa007 26/07/2008 at 8:01 am

Thats pretty cool,
Fake Adsense Stats

56 Robert 28/07/2008 at 5:20 pm

Wow. I just tried that and it is a bit scary. However, will be neat to play joke on my sons with it.

Peace

57 Nishi 30/07/2008 at 12:24 am

Wow, now I think this infomation is worth more than the books “millionaire authors” sell.

58 CodyG!!!!! 03/08/2008 at 1:49 am

U can turn editing off by entering

javascript:document.body.contentEditable=’false’; document.designMode=’on’; void 0

and the edit mode will be off.

59 betty 08/08/2008 at 5:39 am

Ok now I have to try it…

60 abcd 21/08/2008 at 1:14 pm

cant we then save what we have edited suppose i add funds in account and then cant it be save refering page see the same page that is original so there is no saving of page

61 Grover 03/10/2008 at 3:33 pm

How do you save it when you are done with editing?

Leave a Comment (get an avatar from Gravatar first)

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>