// ==UserScript== // @name inactivesearch - openAll in new tab // @namespace http://tampermonkey.net/ // @version 2025-06-01 // @description Add a button which open all result in the page on the new tab // @author @bence04 // @match https://www.inactivesearch.it/* // @icon https://www.google.com/s2/favicons?sz=64&domain=inactivesearch.it // @grant none // ==/UserScript== (function() { 'use strict'; function getPositionLinks() { const links = []; document.querySelectorAll('table.table-inactives a[href*="position_details.php"]').forEach(a => { links.push(a.href); }); return links; } function showConfirmationDialog(linkCount, callback) { if (localStorage.getItem("travianSkipConfirm") === "true") { callback(true); return; } const overlay = document.createElement('div'); overlay.style.position = 'fixed'; overlay.style.top = '0'; overlay.style.left = '0'; overlay.style.width = '100%'; overlay.style.height = '100%'; overlay.style.backgroundColor = 'rgba(0,0,0,0.5)'; overlay.style.zIndex = '9999'; overlay.style.display = 'flex'; overlay.style.justifyContent = 'center'; overlay.style.alignItems = 'center'; const message = `Are you sure you want to open all (${linkCount}) position details in new tabs?\n\n` + `Notice: Some browsers may block multiple tabs from opening automatically. You might need to allow pop-ups in the top corner after clicking "Always Allow".`; const dialog = document.createElement('div'); dialog.style.background = '#fff'; dialog.style.padding = '20px'; dialog.style.borderRadius = '8px'; dialog.style.boxShadow = '0 0 10px rgba(0,0,0,0.3)'; dialog.innerHTML = `
${message}