將選定的元素在背景分頁或新分頁開啟
当前为
// ==UserScript==
// @name Open Elements in Background Tab
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 將選定的元素在背景分頁或新分頁開啟
// @author You
// @match https://tixcraft.com/ticket/area/*
// @grant GM_openInTab
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// 選擇所有符合條件的 `<a>` 元素,這裡假設使用 class `select_form_b` 作為範例
const elements = document.querySelectorAll('.select_form_b > a');
elements.forEach(element => {
// 使用 GM_openInTab 以在背景分頁開啟
GM_openInTab(element.href, { active: false });
});
})();