Results 1 to 4 of 4

Thread: what to replace 'window.open' with

  1. #1
    Hud4007's Avatar
    Hud4007 is offline »Err«Restoring Link..Done
    Join Date
    Jan 2009

    Question what to replace 'window.open' with

    currently, i am creating a mini browser for the wii internet channel and allot of people are tired of popup windows so i want my script to include
    is there any code i could include other than blank quotes so not as many javascript errors occur, and i also would like to search external scripts for the 'window.open' value, but i wouldnt know how to execute the script before the window opens, or how to search through external scripts
    any help?
    if there are any typos, this is to be expected. i am using the wiimote only, and its hard to detect errors

    edit---i also forgot to mention the need to get rid of this that break out of frame
    i have links covered by replace('_top','_self');replace('_blank','_self')
    Last edited by Hud4007; 01-14-2009 at 11:58 PM.

  2. #2
    Join Date
    Apr 2003
    If this is an attempt to edit documents on a different domain you will not be successful.
    Preventing a 'breakout frame script' is also not possible.

  3. #3
    Join Date
    Jul 2008
    urbana, il
    you cannot count on being able to get the source of external javascript files.
    sometimes they are on the same server, and you can ajax them in.
    but some javascript files (jQuery) come to mind can be hosted on 3-rd party sites, and the text of thier code has been compressed, so that "window.open" might not even appear as a string in the code.

    a much simpler technique is to clobber.
    for example:
    window.open = function(){}
    (tested on Opera-Wii)

    will break pop-up functionality for that page.
    just throw it somwhere in a script tag and popups will do nothing...

    i have done the same type of thing to arrest frame break-outs before as well.
    but since ecma does not spec what should happen when clobbering natives, browsers handle such an action on their own whims.
    youll have to play around with it and see if you can get something working for opera. look into clobbering top and self...
    Last edited by rnd me; 01-15-2009 at 09:24 AM.

  4. #4
    Hud4007's Avatar
    Hud4007 is offline »Err«Restoring Link..Done
    Join Date
    Jan 2009
    I have found a way to get rid of targets, althought i find this crude.
    make an object with type="text/plain" and data="URL", then put that into a textarea and do the replace method there, and put result in a <div>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles