Greasy Fork

Greasy Fork is available in English.

Linkedin Enhancer-Logo&Favicon invisiable

Enhance your LinkedIn experience with this script! Hide favicon & navbar on linkedin web page. Feel free to seek new oppotunities when you're at work. lol

当前为 2024-01-09 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Linkedin Enhancer-Logo&Favicon invisiable
// @namespace    Feioura
// @author       Feioura
// @version      0.2
// @description  Enhance your LinkedIn experience with this script! Hide favicon & navbar on linkedin web page. Feel free to seek new oppotunities when you're at work. lol
// @match        https://www.linkedin.cn/*
// @match        https://www.linkedin.com/*
// ==/UserScript==

(function() {

    const pathName = window.location.pathname
    const hostName = window.location.hostname
    let pageType
    if (pathName.indexOf('jobs') >= 0) {
        pageType = 'jobs'
    } else if (pathName.indexOf('company')>=0) {
        pageType = 'company'
    }

    'use strict';

    //learn from adlered, change favicon & page title of linkedin to github.
    window.onload = function () {
    const fake_title = 'GitHub'
    const fake_icon = 'https://github.githubassets.com/favicon.ico'
    let link =
    document.querySelector("link[rel*='icon']") ||
    document.createElement('link')
    window.document.title = fake_title
    link.type = 'image/x-icon'
    link.rel = 'shortcut icon'
    link.href = fake_icon
    document.getElementsByTagName('head')[0].appendChild(link)
    }


    console.log(pageType);

    switch (pageType) {
        case 'jobs':
            fixJobsPage()
            break
        case 'company':
            fixCompanyPage()
            break
    }

    function fixJobsPage () {
        let cssFix = document.createElement('style')
        cssFix.innerHTML += '.NavigationBar_globalNav__OJ-ym{display:none !important;}'
        document.getElementsByTagName('head')[0].appendChild(cssFix)
    }

    function fixCompanyPage () {
        let cssFix = document.createElement('style')
        cssFix.innerHTML += '.NavigationBar_globalNav__OJ-ym{display:none !important;}'
        document.getElementsByTagName('head')[0].appendChild(cssFix)
    }


/*
    // Add empty favicon to <head> tag ---- gpt provides, invalid, i don't know why.

    var link = document.createElement('link');
    link.rel = 'icon';
    link.href = 'data:,';
    document.getElementsByTagName('head')[0].appendChild(link);


    // Hide <a> element with class "NavigationBar_logo__NZeDh" ---- gpt provides, invalid, i don't know why.
    var logoElement = document.querySelector('a.NavigationBar_logo__NZeDh');
    if (logoElement) {
        logoElement.style.display = 'none';
    }
*/


})();