Open NewAtlas Links in New Tab (Auto Refresh)

Opens all links on NewAtlas in a new tab and refreshes the page every 2 seconds

  1. // ==UserScript==
  2. // @name Open NewAtlas Links in New Tab (Auto Refresh)
  3. // @namespace http://www.example.com
  4. // @version 1.0
  5. // @description Opens all links on NewAtlas in a new tab and refreshes the page every 2 seconds
  6. // @author Your Name
  7. // @match https://newatlas.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to add target="_blank" to the links
  16. function openLinksInNewTab() {
  17. // Get all the anchor tags on the page
  18. var links = document.querySelectorAll('a');
  19.  
  20. // Loop through each anchor tag
  21. for (var i = 0; i < links.length; i++) {
  22. // Add target="_blank" to open the link in a new tab
  23. links[i].setAttribute('target', '_blank');
  24. }
  25. }
  26.  
  27. // Execute the function initially
  28. openLinksInNewTab();
  29.  
  30. // Execute the function every 2 seconds
  31. setInterval(openLinksInNewTab, 2000);
  32. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址