True caller

Search truecaller database

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.

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

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

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

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

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

// ==UserScript==
// @name         True caller
// @namespace    https://greasyfork.org/en/users/728780-turbo-cafe-clovermail-net
// @description  Search truecaller database
// @include      *
// @version      1.01
// @run-at       document-idle
// @author       [email protected]
// @grant        GM_registerMenuCommand
// ==/UserScript==

(function () {
    function linkifyPhoneNumber() {
        document.body.normalize();
        function linkifyNode(n) {
            var M, R, currentNode;
            if (n.nodeType == 3) {
                const phonePosition = n.data.search(/\+380[^\s]*/);
                if (phonePosition < 0) return;
                M = n.splitText(phonePosition);
                R = M.splitText(RegExp.lastMatch.length);
                const linkTag = document.createElement("A");
                linkTag.href = "https://www.truecaller.com/search/ua/" + M.data;
                linkTag.appendChild(M);
                R.parentNode.insertBefore(linkTag, R);
            } else if (n.tagName != "STYLE" && n.tagName != "SCRIPT" && n.tagName != "A")
                for (let i = 0; currentNode = n.childNodes[i]; ++i) {
                    linkifyNode(currentNode);
                }
        }
        linkifyNode(document.body);
    }
    GM_registerMenuCommand('Linkify phone number', linkifyPhoneNumber);
})();