show link border demo🔧

for surface

目前为 2023-06-11 提交的版本。查看 最新版本

// ==UserScript==
// @name         show link border demo🔧
// @description  for surface
// @namespace    show_link_border
// @author       Covenant
// @version      1.0.1
// @license      MIT
// @homepage
// @match        *://*/*
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAPFBMVEUAAACvDwOyDwKyDwOvEACyDgOyDwKvDwKwDgCyDgKxDgOyDgKvDgKyDwKyDgOxDgKzDgKxDgKxEASyDwMgW5ZmAAAAE3RSTlMAQN+/EJDvMB9wYJ9Qz7CAf6CAtGoj/AAAAcFJREFUSMeVltu2gyAMRLlfBDxt+f9/PTq2VXSwmod2GdhkEoIiiPmYinK1VqXt4MUFk9bVxlTyvxBdienhNoJwoYMY+57hdMzBTA4v4/gRaykT1FuLNI0/j/1g3i2IJ8s9F+owNCx+2UlWQXbexQFjjTjN1/lGALS9xIm9QIXNOoowlFKrFssYTtmvuOXpp2HtT6lUE3f11bH1IQu9qbYUBEr7yq8zCxkWuva8+rtF4RrkP6ESxFPoj7rtW30+jI4UQlZuiejEwZ4cMg65RKjjUDz6NdwWvxw6nnLESEAl230O5cldUAdy8P44hJZTYh40DOIKzFw3QOI6hPk9aDiFHJc3nMirKERgEPd7FKKgiy5DEn3+5JsrAfHNtfjVRLucTPTaCA1rxFVz6AX8yYsIUlXoMqbPWFUeXF1Cyqz7Ej1PAXNBs1B1tsKWKpsX0yFhslTetL4mL8s4j2fyslTbjbT7Va2V7GCG5ukhftijXdsoQhGmzSI4QhHGhVufz4QJ/v6Hug6dK0EK3YuM8/3Lx5h3Z0STywe55oxRejM5Qo4aAtZ8eTBuWp6dl3IXgfnnLpyzBCFctHomnSopejLhH/3AMfEMndTJAAAAAElFTkSuQmCC
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_registerMenuCommand
// @connect
// @run-at       document-end
// @noframes
// ==/UserScript==
var anchor_border_style=GM_getValue("anchor_border_style", 'dashed');
var remove_anchor_width=GM_getValue("remove_anchor_width", false);
function create_style(textContent,id,class_name){
    let style=create_node("style",class_name,true,document.body);
    style.type='text/css';
    style.id=id;
    style.textContent=textContent;
    return style;
}
function create_node(tagname,class_name,is_appendChild,node,refNode){
    let element=document.createElement(tagname);
    if(Array.isArray(class_name)){
        for(let i=0; i<class_name.length; i++){element.classList.add(class_name[i]);}
    }
    else if(typeof class_name==='string'){element.classList.add(class_name);}
    if(is_appendChild){node.appendChild(element);}else{node.insertBefore(element, refNode);}
    return element;
}
var style_user_css=create_style("a{border-style: "+anchor_border_style+" !important;border-color: #707070 !important; border-width: 1px !important;border-radius: 4px;padding: 2px;}\n","gm_user_css_show_link_border",["user_gm_css","css_show_link_border"]);
if(remove_anchor_width)style_user_css.textContent+="a{width: auto !important;min-width: 0.1rem;}\n";
(function() {
    'use strict';
    GM_registerMenuCommand('dashed', () => {
        GM_setValue("anchor_border_style", 'dashed');
    });
    GM_registerMenuCommand('dotted', () => {
        GM_setValue("anchor_border_style", 'dotted');
    });
    GM_registerMenuCommand('double', () => {
        GM_setValue("anchor_border_style", 'double');
    });
    GM_registerMenuCommand('remove link width'+(remove_anchor_width?"✔️":"❌"), () => {
        GM_setValue("remove_anchor_width", !remove_anchor_width);
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址