Greasy Fork is available in English.
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
当前为
// ==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';
}
*/
})();