faviconizer

Show favicons for links.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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);