Greasy Fork

来自缓存

Greasy Fork is available in English.

查看页面的标题和描述

获取任意网站的标题、描述以及当前页面的链接,内容会显示在console中,按F12-》控制台(或者右键页面任意位置,选择检查-》控制台)即可打开查看

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         查看页面的标题和描述
// @namespace    http://tampermonkey.net/
// @version      20211015104403
// @description  获取任意网站的标题、描述以及当前页面的链接,内容会显示在console中,按F12-》控制台(或者右键页面任意位置,选择检查-》控制台)即可打开查看
// @author       You
// @match        http://*/*
// @match        https://*/*
// @icon         https://www.google.com/s2/favicons?domain=gitee.io
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    let timer = setTimeout(() => {

        clearTimeout(timer);
        timer = null;
        let title = document.title;
        console.log(title);
        let metaArr = document.head.querySelectorAll("meta");
        if (metaArr.length > 0) {
            metaArr.forEach((res) => {
                if (res.name.toLocaleLowerCase() === "description") {
                    console.info(res.content);
                }else if(res.getAttribute("property") === 'description'){
                    console.info(res.content);
                }
            });
        }
        let href = location.href
        console.log(href)
    }, 2000);
})();