您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Añade target="_blank" a enlaces que contienen "/resource/" o a dominios externos en todas las páginas
// ==UserScript== // @name Añadir target _blank a enlaces con "/resource/" o a dominios externos // @namespace https://moodle.iesmontsia.org // @license MIT // @version 1.0 // @description Añade target="_blank" a enlaces que contienen "/resource/" o a dominios externos en todas las páginas // @author Tu Nombre // @match https://moodle.iesmontsia.org/* // @grant none // ==/UserScript== (function() { 'use strict'; document.addEventListener('click', function(event) { if (event.target.tagName === 'A') { const enlace = event.target; if (enlace.href.includes("/resource/") || enlace.hostname !== window.location.hostname) { event.preventDefault(); window.open(enlace.href, '_blank'); } } }); })();