kuan-url-copy

2023/12/4 09:11:30

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        kuan-url-copy
// @match       https://www.coolapk.com/link?*
// @namespace   http://github.com/zhichengroup/kuanurl
// @grant       none
// @version     1.0
// @author      zcg
// @description 2023/12/4 09:11:30
// ==/UserScript==

(function () {
  'use strict';
  console.info('开启酷安自动跳转脚本');
  var url = document.getElementsByTagName('p')[0].innerText;

  var a =document.createElement('a');
  a.innerHTML = '<a href="' + url +'">open</a>';
  document.body.appendChild(a);

  var b =document.createElement('button');
  b.innerText='copy url'
  b.onclick=function(){
    var oInput = document.createElement('input');
    oInput.value = url;
    document.body.appendChild(oInput);
    oInput.select(); // 选择对象
    document.execCommand("Copy"); // 执行浏览器复制命令
    oInput.className = 'oInput';
    oInput.style.display = 'none';
    alert('复制成功');
  }
  document.body.appendChild(b);

})();