🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/10 05:01:50
🔄 下次更新时间:2026/01/10 06:01:50
手动刷新缓存

noopener-everywhere

open any hyperlinks with a noopener attribute

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         noopener-everywhere
// @name:zh-CN   全员noopener
// @name:zh-TW   全員noopener
// @namespace    https://github.com/li-zyang
// @version      1.0.0
// @description  open any hyperlinks with a noopener attribute
// @description:zh-CN  使用 noopener 方式打开任何新窗口的链接
// @description:zh-TW  使用 noopener 方式打開任何外部錨
// @author       阿昭
// @include      *://*
// @exclude      none
// @require      https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_deleteValue
// @grant        GM_addStyle
// @grant        GM_setClipboard
// @grant        GM_xmlhttpRequest
// @grant        GM_registerMenuCommand
// @connect      *
// @noframes
// @run-at       document-end
// @note         v0.1.0      2020-03-24  On testing
// @note         v1.0.0      2020-03-27  First published
// ==/UserScript==

// => More metadata:
// @contributor  the contributors of this script
// @homepageURL  the homepage of this script (commonly <sth>.io)
// @supportURL   Defines the URL where the user can report issues and get personal support. (such as https://greasyfork.org/scripts/41537)
// @icon         url of the icon for this script, data64 is okay
// @license      license of this script
// @compatible   descript compatibility, just a human-readable message
// @match

// See https://www.tampermonkey.net/documentation.php for full documention

(function(window, $) {
  'use strict';
  $('a[href]')
    .not('[href=""]')
    .not('[href^="#"]')
    .not('[href^="javascript:"]')
  .each(function(element_index) {
    if (! $(this).attr('rel') ) {
      $(this).attr('rel', 'noopener');
    } else if (! /(\s|^)noopener(\s|$)/.test($(this).attr('rel')) ) {
      $(this).attr('rel', $(this).attr('rel') + ' noopener');
    }
  });
  let observer = new MutationObserver(function(mulist) {
    for (var mutation of mulist) {
      if (mutation.type == 'childList') {
        let jq_target = $(mutation.target);
        jq_target.find('a[href]')
          .not('[href=""]')
          .not('[href^="#"]')
          .not('[href^="javascript:"]')
        .each(function(element_index) {
          if (! $(this).attr('rel') ) {
            $(this).attr('rel', 'noopener');
          } else if (! /(\s|^)noopener(\s|$)/.test($(this).attr('rel')) ) {
            $(this).attr('rel', $(this).attr('rel') + ' noopener');
          }
        });
      }
    }
  });
  observer.observe($('body')[0], {
    childList: true,
    subtree: true
  });
})(window.unsafeWindow, $);