Expert help please: 'parentwin' HTML syntax...

Discussion in 'Internet Explorer' started by Jeremy, Jan 31, 2007.

  1. Jeremy

    Jeremy Guest

    Hi,

    Going to post a bit of HTML here. This opens a Google search by highlighting
    text and choosing 'Google' from the context menu. However, it opens the new
    tab in the background, regardless of the Tab Preferences settings in IE. Can
    someone tell me how to modify it to force the result in a new 'focussed' tab.
    Thanks...here it is:

    <SCRIPT LANGUAGE="JavaScript">
    var parentwin = external.menuArguments; var doc = parentwin.document;
    var sel = doc.selection; var rng = sel.createRange(); var str = new
    String(rng.text);
    if (str.length > 0)
    parentwin.open("http://www.google.co.uk/search?q="+rng.text,
    "_blank");</SCRIPT>
     
    Jeremy, Jan 31, 2007
    #1
    1. Advertisements

  2. Hello,

    Unfortunately it is not possible to control whether a new tab or window is
    opened via script. It depends on the local tab settings under internet
    options how IE deals with new pop-up windows.

    Best regards,

    Viktor
     
    Viktor Krammer, Jan 31, 2007
    #2
    1. Advertisements

  3. Jeremy

    Jeremy Guest

    Well, I beg to differ Viktor. The code I posted DOES open the search results
    in a new tab. It just opens it behind the current tab, in the same window. No
    major deal, it would just be nice to force it to the front.
     
    Jeremy, Jan 31, 2007
    #3
  4. Hello Jeremy,

    As I said you cannot do this via script. To achieve this you have to write
    an add-on. I have implemented the described right-clicking feature in Quero
    and let the user configure whether to open the search in a foreground or
    background tab.

    Best regards,

    Viktor
     
    Viktor Krammer, Jan 31, 2007
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.