Help with opening javascript links in new tabs with firefox.

By vnf4ultra ยท 6 replies
Jun 4, 2006
  1. Hello all.

    I really enjoy using firefox's tabbed interface, and it works great for 99% of webpages, but one website I have to use uses javascript links, and when I middle click the links I get a blank page. I've tried the smart middle click extension for firefox, and also the javascript in new tab script for greasemonkey. Neither will work properly with the site. The greasemonkey script duplicates the original tab, instead of opening the desired page, while the smart middle click link basically does nothing on this site.

    The links on the website are like this:
    the ****** is just letters and numbers.

    Is there a way to modify the "javascript in new tab" script to make it work properly? If I could get it to duplicate the tab first, then run the javascript after the new tab has loaded, it would be great.

    Here's the script I want to modify (it is ok to modify someone else's script right?).

    I don't know a lot about scripts or programming, so take it easy on me.
  2. jobeard

    jobeard TS Ambassador Posts: 11,138   +985

    it's not the fault of the javascript :)

    pages are written for Frames or NoFrames and you can tell the difference
    by looking at the ANCHOR tag (ie the link)
    <a target="xxx" href="<script ..>foo();</script>">click here</a>
    the XXX is the name of the window to display the results from the foo() script

    If it is NOT written in this style, right-click for new tab will get exactly what you report, and there's nothing you can do about it.
  3. vnf4ultra

    vnf4ultra TechSpot Paladin Topic Starter Posts: 1,388

    So there's no way to get my desired result?
    There has to be some way.
    The links look like this.

    <td align=middle valign="top"><small><a href="/Web/jsp/search/Authorize.jsp?skus=X654230">Click Here</a></small></td>

    The a href doesn't refer to the complete address though, it seems like it "reuses" the current address, but replaces part of it.

    (yeah, I know almost nothing about javascript...)

    Not sure if that's helpful or not.
  4. jobeard

    jobeard TS Ambassador Posts: 11,138   +985

    <TD> is a table cell
    the HRef is not javascript but rather a JavaServerPage (JSP)
    {using FireFox} right click on Click Here should give the choice for New Window or New Tab and
    the result from the server JSP should occur on the window choice you made.

    Notice; the USER makes the choice for NEW TAB, not the script

    All you can do (if you're page has the script) is add
    <a target="_new" href=...>
  5. vnf4ultra

    vnf4ultra TechSpot Paladin Topic Starter Posts: 1,388

    If I right click the link, it doesn't have any "open in new tab", or "open in new window." If I right click the link and select properties, it says link will open in: same window.

    I guess I can't do what I want.

    Thanks for the help though.
  6. jobeard

    jobeard TS Ambassador Posts: 11,138   +985

    huh? Current versions of FireFox present
    the attached menu... what version do you have anyway?

    Attached Files:

  7. vnf4ultra

    vnf4ultra TechSpot Paladin Topic Starter Posts: 1,388

    Here's what I get when I right click the javascript link that I'm trying to middle click. The picture should explain it well.

    Attached Files:

Topic Status:
Not open for further replies.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...