|
爱科技、爱创意、爱折腾、爱极致,我们都是技术控
您需要 登录 才可以下载或查看,没有账号?立即注册
x
论坛默认是在当前页打开帖子,经常看完后随手就关闭了,不太方便。写了个油猴脚本,在新标签中打开帖子,不怕点错了。
- // ==UserScript==
- // [url=home.php?mod=space&uid=1732443]@name[/url] 数码之家开新标签
- // @namespace http://tampermonkey.net/
- // [url=home.php?mod=space&uid=1308568]@version[/url] 2024-05-23
- // @description try to take over the world!
- // [url=home.php?mod=space&uid=2115719]@author[/url] You
- // [url=home.php?mod=space&uid=2296854]@match[/url] https://www.mydigit.cn/forum-*
- // [url=home.php?mod=space&uid=1703210]@icon[/url] https://www.google.com/s2/favicons?sz=64&domain=mydigit.cn
- // [url=home.php?mod=space&uid=1101085]@grant[/url] none
- // ==/UserScript==
- (function() {
- 'use strict';
-
- setTimeout(() => {
- var links = document.getElementsByTagName('th')
-
- for(let i=2;i< links.length;i++){
- var link2 = links[i].getElementsByTagName('a');
-
- for(let j=2;j< link2.length;j++){
- // 拿到每一个url
- let url = link2[j].href;
- link2[j].href = "javascript=void(0);";
- link2[j].onclick = function(event1){
- event1.preventDefault();
- window.open(url,"_blank");
- }
- }
-
- }
- },2000)
- })();
复制代码
|
|