www.webdeveloper.com
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
    Posts
    29

    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
    Code:
    getElementsByName('tab').innerHTML.replace('window.open','')
    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 10:58 PM.
    ( '' ) Kirby
    Kirby, Dance!!!
    <( ''<) (^''^) (>'' )>
    simple letter/character combos can work wonders

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    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.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    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:
    Code:
    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 08:24 AM.

  4. #4
    Hud4007's Avatar
    Hud4007 is offline »Err«Restoring Link..Done
    Join Date
    Jan 2009
    Posts
    29
    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>
    ( '' ) Kirby
    Kirby, Dance!!!
    <( ''<) (^''^) (>'' )>
    simple letter/character combos can work wonders

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