0

When you put this in your browser it opens a simple notepad to type in.

I don't know enough about javascript to alter it but I would like to make it so it DOESN'T open in a new window but rather in the current window or another tab.

Is this even possible?

javascript:pwin=window.open('','_blank','menubar=yes,scrollbars=yes,location=no,height=450,width=350');pwin.document.body.contentEditable='true';pwin.document.designMode='on';void(0);if(window.focus){pwin.focus()};
Shog9
  • 156,901
  • 35
  • 231
  • 235
  • You might like this... http://lifehacker.com/398139/edit-any-web-page-with-a-bookmarklet – Shog9 Oct 18 '10 at 19:09

4 Answers4

2

Technically, window.open does not always open in a new window. You can use _self instead of _blank, and it will open in the same window. Or use _parent and it will open in the current frame's parent.

DOK
  • 32,337
  • 7
  • 60
  • 92
0

Window.open always opens this in a new window. Instead I think you can try window.location. Not tried tough.

Sachin Shanbhag
  • 54,530
  • 11
  • 89
  • 103
0

Ok did a little digging and there is nothing you can do that will guarantee that it will open in a new tab. However if you remove the width and height parameters some browsers will open in a new tab if user preferences haven't overridden this behavior. See this post (2nd answer in list) Stackoverflow post

Community
  • 1
  • 1
Adrian
  • 2,911
  • 1
  • 17
  • 24
0

If you aren't looking to open a window, then don't window.open()

Setting window.location should do the trick, as pointed out by Sachin

Montagist
  • 394
  • 2
  • 8