Facebook (Show URLS on Posts)

Shows Post URL Information on Facebook Posts

目前为 2021-04-01 提交的版本。查看 最新版本

// ==UserScript==
// @name     Facebook (Show URLS on Posts)
// @match    https://www.facebook.com/*
// @match    https://*.facebook.com/*
// @match    http://www.facebook.com/*
// @match    http://*.facebook.com/*
// @run-at   document-start
// @grant    GM_addStyle
// @author   JZersche
// @require  https://gf.qytechs.cn/scripts/12228/code/setMutationHandler.js
// @version 1.00
// @namespace https://gf.qytechs.cn/users/95175
// @description Shows Post URL Information on Facebook Posts
// ==/UserScript==


let event = new MouseEvent('pointerover', {'bubbles': true});

setMutationHandler({
    target: document.querySelector('.qzhwtbm6.knvmm38'),
    selector: '.oajrlxb2.gpro0wi8.b1v8xokw',
    handler: nodes => nodes.forEach(node => {
        setTimeout(function(){
            node.dispatchEvent(event);
            setTimeout(function(){
                if(node.href.length>100 && !node.outerHTML.match('tm_injection') && window.location.href.match(/facebook\.com\/\w+/)) {
                    //node.parentNode.parentNode.nextSibling.innerText = ' · ';
                    console.log('node');
                    try{node.parentNode.parentNode.nextSibling.innerText = ' ';}catch(e){}
                    node.href = node.href.replace(node.search,'');
                    node.href;node.insertAdjacentHTML('beforeend','<br /><span class="tm_injection"> '+node.href.match(/\.com\/.+/)[0].replace('.com/','')+'</span>');
                    //node.children[0].setAttribute('style','background-image: linear-gradient(to left, white 50%, green 60%, white 60%, blue 70%, violet 80%);-webkit-background-clip: text;');
                    //node.children[2].setAttribute('style','background-image: linear-gradient(to left, violet, blue, green, red, white);-webkit-background-clip: text;');
                }
            },250)
        },3000);
    return false})
})

QingJ © 2025

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