欢迎注册论坛,享受更多奶昔会员权益!
您需要 登录 才可以下载或查看,没有账号?注册
×
本帖最后由 veo 于 2025-11-24 00:14 编辑
刚写的内容不见,去回了其他贴,找不到哪个标签页了,这是个问题。@nyarime
这应该是大量使用了window.open,onclick和click都会默认调用window.open,得修,
正确的方法:少量使用window.open,改用location.href
啊,又不见了,找标签页头大
target,_blank_都要少用,早点完善一下。
顺便给一个临时解决方法
禁用新标签页打开的小工具,控制台就能运行,加入书签也是可以的
- (function (window) {
- "use strict";
- let base = document.querySelector('base');
- if (base) base.removeAttribute('target');
- document.addEventListener('mousedown', function (event) {
- var a = event.target, depth = 3;
- while (a && a.tagName != 'A' && depth-- > 0) {
- a = a.parentNode;
- }
-
- if (a && a.tagName == 'A') {
- a.removeAttribute('target');
- a.removeAttribute('onclick');
- if (document.domain.endsWith(".naixi.net")) {
- a.onclick = (e) => e.stopImmediatePropagation();
- }
- var u = new URL(a.href);
- var p = u.searchParams
- var t = p.get("target")||p.get("to");
- if (t) { a.href = t; }
- }
- }, true);
- })(window);
复制代码
|