Help with opening javascript links in new tabs with firefox.

By vnf4ultra
Jun 4, 2006
Topic Status:
Not open for further replies.
  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:
    javascript:go2TechNotes('******')
    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?).
    http://www.arantius.com/misc/greasemonkey/javascript-in-new-tab.user.js

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

    jobeard TS Ambassador Posts: 13,288   +281

    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)
    Code:
    <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: 2,195

    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: 13,288   +281

    <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: 2,195

    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: 13,288   +281

    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: 2,195

    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.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.