Skip to content

Commit bfaded1

Browse files
committed
优化 代码
1 parent 1e9b42b commit bfaded1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

TargetBlank.user.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 新标签页打开链接
3-
// @version 1.0.2
3+
// @version 1.0.3
44
// @author X.I.U
55
// @description 将网页中所有链接改为新标签页打开~
66
// @match *://*/*
@@ -27,6 +27,7 @@
2727

2828
// 修改为新标签页打开
2929
function targetBlank() {
30+
document.head.appendChild(document.createElement('base')).target = '_blank';
3031
Array.from(document.links).forEach(function (_this) {
3132
if (_this.href && _this.href.slice(0,4) === 'http') {
3233
_this.target = '_blank'

0 commit comments

Comments
 (0)