adsjcxeicxzs

adsjcxeicxzs

V2EX 第 636049 号会员,加入于 2023-06-27 13:52:19 +08:00
根据 adsjcxeicxzs 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
adsjcxeicxzs 最近回复了
35 天前
回复了 tog 创建的主题 生活 有没有戒烟成功的?
@zaunist 感觉并不是一根不吸才叫戒掉了烟, 偶尔吸一两根其实还好... 我的做法是不买烟, 只要家里没烟也懒得去买. 一年下来可能就三四盒, 基本是出去玩跑高速会买一包
62 天前
回复了 sunny1827 创建的主题 生活 因旅游和老婆吵架了
个人观点: 正确做法: 支持她, 并且把家里一切照顾好让她能够放心开心的玩, 尽量在这期间少联系少打扰她. 好的关系应该祝福彼此变得更好更快乐.
68 天前
回复了 JoeLin33 创建的主题 问与答 大家看好高德扫街榜吗?
@luojianxhlxt 正是如此, 再熟悉的路也要导航, 因为要避免拥堵或事故的意外情况, 以及可以观察红绿灯倒计时...
69 天前
回复了 SayHelloHi 创建的主题 生活 兄弟们 跪求 有用的灭蟑螂药~~
拜灭士 + 蟑螂屋, 之前半夜蟑螂爬到冰箱直接跳闸... 一直以为是冰箱不太好了, 知道发现了大蟑螂... 并且有一天半夜直接爬到了脸上!!!! 恐惧啊... 后来用了蟑螂屋和拜灭士立竿见影. 应该是有用的, 我那会抓到的蟑螂最少也是几十只了. 注意蟑螂屋和下药的位置也比较重要, 最好阴暗的地方都放上
69 天前
回复了 zhangsimon 创建的主题 推广 分享下自己副业,顺便抽个奖
分子+1
88 天前
回复了 sosme 创建的主题 分享创造 [油猴脚本] 强制所有链接在新标签页打开
谢谢 op, 使用中发现一个问题, 一些 pop 不需要跳转, 比如 v2 的感谢按钮, 所以更新了一版

// ==UserScript==
// @name Force All Links to Open in New Tab
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Make all links open in a new tab, while keeping the original page unchanged
// @match *://*/*
// @grant none
// @license MIT
// ==/UserScript==

(function () {
'use strict';

function isPopupOrInteractiveLink(link) {
const url = link.href;

// Check if link has any event handlers (interactive functionality)
if (link.onclick || link.getAttribute('onclick') ||
link.getAttribute('onmousedown') || link.getAttribute('onmouseup')) {
return true;
}

// Check for data attributes that indicate JavaScript functionality
if (link.hasAttribute('data-toggle') || link.hasAttribute('data-target') ||
link.hasAttribute('data-dismiss') || link.hasAttribute('data-action') ||
link.hasAttribute('data-modal') || link.hasAttribute('data-popup')) {
return true;
}

// Check for CSS classes that typically indicate interactive elements
const interactiveClasses = ['modal-trigger', 'popup-trigger', 'lightbox-trigger',
'dialog-trigger', 'overlay-trigger', 'accordion-trigger',
'tab-trigger', 'dropdown-trigger', 'tooltip-trigger'];
if (interactiveClasses.some(cls => link.classList.contains(cls))) {
return true;
}

// Check for hash-only links that are used for JavaScript interactions
if (url.endsWith('#') || url.endsWith('#;') || url.includes('#!') ||
url === window.location.href + '#' || url === '#') {
return true;
}

// Check for javascript: URLs
if (url.startsWith('javascript:')) {
return true;
}

// Check for void(0) patterns
if (/void\(0\)/i.test(url)) {
return true;
}

// Check for same-page anchors (internal page navigation)
if (url.includes('#') && url.split('#')[0] === window.location.href.split('#')[0]) {
return true;
}

// Common popup URL patterns
const popupPatterns = [
/popup/i, /modal/i, /overlay/i, /lightbox/i, /dialog/i, /window\.open/i,
/fancybox/i, /colorbox/i, /thickbox/i, /magnific/i, /photoswipe/i,
/gallery/i, /slideshow/i, /carousel/i, /accordion/i, /tabs?/i,
/dropdown/i, /tooltip/i, /share/i, /social/i
];

return popupPatterns.some(pattern => pattern.test(url));
}

function openInNewTab(event) {
const link = event.target.closest('a'); // Find the clicked link
if (link && link.href && !link.hasAttribute('target')) {
// Check if this is a popup or interactive link
if (isPopupOrInteractiveLink(link)) {
// Let popup/interactive links behave normally (don't interfere)
return;
}

event.preventDefault(); // Block the default behavior
event.stopPropagation(); // Prevent bubbling so internal JS won't trigger navigation
setTimeout(() => {
window.open(link.href, '_blank'); // Open link in a new tab
}, 50); // Small delay for compatibility
}
}

// Attach the click listener to the whole document
document.addEventListener('click', openInNewTab, true);
})();
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3795 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 00:53 · PVG 08:53 · LAX 16:53 · JFK 19:53
♥ Do have faith in what you're doing.