faviconizer

Show favicons for links.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         faviconizer
// @namespace    01
// @version      0.1
// @description  Show favicons for links.
// @author       fbr10
// @exclude      https://www.yandex.ru/search/*
// @exclude      https://www.google.ru/search*
// @exclude      https://www.bing.com/search*
// @exclude      https://nova.rambler.ru/search*
// @include      *://*/*
// @include      http://*
// @include      https://*
// @grant        none
// ==/UserScript==

(function(d) {
    'use strict';

  var faviconDiv = d.createElement('div');
  faviconDiv.style.display = 'none';
  faviconDiv.style.position = 'fixed';
  faviconDiv.style.width = '16px';
  faviconDiv.style.height = '16px';
  faviconDiv.style.border = '1px solid red';
  faviconDiv.style.boxShadow = '3px 3px 5px #808080';
  faviconDiv.style.zIndex = '9999';
  var favicon = d.createElement('img');
  faviconDiv.appendChild(favicon);
  d.body.appendChild(faviconDiv);

  var a = d.querySelectorAll('a');
  for (var i = 0; i < a.length; i++) {
    a[i].addEventListener("mouseover", faviconizer, false);
    a[i].addEventListener("mouseout", clean, false);
  };

  function faviconizer (event) {
    var host = this.host.replace(/www\./, "");
    var localhost = d.location.host.replace(/www\./, "");

    if (host === '' || host === localhost) {
        return
    } else {

    favicon.src = "https://www.google.com/s2/favicons?domain=" + host;

    faviconDiv.style.left = event.clientX + 30 + 'px';
    faviconDiv.style.top = event.clientY - 30 + 'px';
    faviconDiv.style.display = 'block';
  };
};

  function clean() {
    faviconDiv.style.display = 'none';
  };

})(document);