一键获取网站Cookie脚本

用来自动获取用户设置的指定网站的Cookie

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         一键获取网站Cookie脚本
// @namespace    http://tampermonkey.net/
// @version      24.0615.1200
// @description  用来自动获取用户设置的指定网站的Cookie
// @author       Yi-Zero

// @match        https://*/*

// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @require      https://unpkg.com/sweetalert/dist/sweetalert.min.js
// ==/UserScript==

(function() {
    'use strict';

let Container = document.createElement('div');
Container.id = "sp-ac-container";
Container.style.position="fixed"
Container.style.left="-28px"
Container.style.top="500px"
Container.style['z-index']="999999"
Container.innerHTML =`<button id="myCustomize" style="width: 50px; height: 50px; border: none; background-color: #1795bb; color: #FFFFFF; border-radius:5px; position:absolute; left:30px; top:20px " >
  复制Cookie
</button>
`
document.body.appendChild(Container);

    // 按钮点击事件处理程序
    Container.addEventListener("click", function() {
        // 在这里添加按钮点击后的逻辑

    var cookies = document.cookie;
    //获取网站Cookie
    console.log("当前网站Cookies:", cookies);
    //控制台输出Cookie
    const text = cookies;
    navigator.clipboard
    .writeText(text)
    // 复制Cookie
    swal("本站Cookie已复制!", "", "success", {
    button: "确定",
    // 弹窗提示
   });

   });

})();