T2Plus

t2toys.com/by_cat.html?cat=86

Ctrl+click cannot open a new tab because these cards are not links.

The listing is a jQuery shell. After GetProductList returns, each product is injected as a <div onclick> that assigns window.location. Browsers only treat Ctrl+click, Cmd+click, and middle-click as “open in new tab” when the target is a real hyperlink with an href.

t2toys pattern

broken

Cards are div elements with onclick. Ctrl+click still replaces this tab.

RX-78-2 Ver.Ka

HK$ 680

EVANGELION Unit-01

HK$ 1,280

Nendoroid 626

HK$ 320Sold

S.H.Figuarts Ultraman

HK$ 450

Real links

works

Same cards as a href="/item/…". Ctrl+click, Cmd+click, and middle-click open a new tab.

Last clicknone yet

Click a card above. Ctrl+click (Cmd+click on Mac) and middle-click both sides, then compare what happens.

How the page is assembled

by_cat.html ships almost empty. The navbar and footer are loaded with $('.navbar').load('nav.html'). The product grid is an empty .row.content.

body
  nav.navbar          ← nav.html
  header#slider       ← unused on this view
  #allItem
    section#products
      h2 All Products
      .row.filter     keyword, sort, attrs
      .row.content    ← cards injected here
  footer              ← footer.html

cat=86 is read with gup('cat') and posted to https://api.t2toys.com/Project/GetProductList as SecondCategoryId. Infinite scroll appends more HTML the same way.

The click path that steals the tab

indexFormProduct concatenates this string for every item:

<div class="col-md-3 productHolder"
     onclick="itemdetailFormDetail(12345)">
  <img src="" style="background:url(...)">
  <h3>Product name</h3>
  <div class="price">HK$ …</div>
</div>

The handler never looks at the event object:

function itemdetailFormDetail (data){
  window.location =
    './item_detail.html?ProductId=' + data;
}

A commented $.get("item_detail.html", { ProductId: data }) would not even change the URL. The live code always navigates the current tab.

Why the browser will not open a new tab

“Open in new tab” is a default action of hyperlinks, not of clicks in general. On a real <a href>, Ctrl+left click (Cmd on macOS) or a middle click tells the browser to load that href in another tab and leave the current page alone.

  1. The click target is a div. There is no href, so the browser has no URL to clone into a tab.
  2. The inline onclick still fires for Ctrl+click. It does not read event.ctrlKey, metaKey, or button.
  3. window.location = … can only replace the current document. It cannot open a tab.

Right-click “Open link in new tab”, Shift+click (new window), dragging a link onto the tab bar, and the status-bar URL preview all fail for the same reason. Keyboard users also cannot Tab to a card and press Enter.

Banner ads on the same page are real anchors (<a href="…"><img>), so Ctrl+click works on ads and fails on products.

The fix

Render an actual link. Keep the existing CSS classes. Drop the onclick.

productsContent +=
  '<a class="col-md-3 productHolder" href="./item_detail.html?ProductId='
  + item["ProductId"] + '">'
  + innerHtml
  + '</a>';

Checking modifier keys and calling window.open is a weaker substitute: it still skips the context menu, crawlers, and keyboard activation. The listing already has a shareable URL shape (item_detail.html?ProductId=); it just never puts that URL on the card.

The seller row on the detail page repeats the bug: $('.user_info').click(…) then window.location = './user_detail.html?UID=' + data. Contact Seller is a <button onclick> that also assigns window.location.

Chrome extension

A Manifest V3 extension in extension/ performs that rewrite on the live t2toys.com site. You can load it unpacked today. Publishing to the Chrome Web Store is possible from a Google developer account (one-time US$5 fee); this project cannot submit it for you.

Install notes, zip download, and store checklist

no <a href> on productsonclick + window.locationads still use real links