PageSourceSearch

https://track24.ru/js/browser.js

js track24.ru collected 2026-10-01 13:05:57 UTC 1,951 bytes, 82 lines download raw bytes

1
2$('.js-browser-btn').each(function () {
3    var $button = $(this);
4    var browser = detectBrowser();
5
6    switch (browser) {
7        case 'firefox':
8            $button.addClass('btn-icon btn-icon--firefox');
9            break;
10        case 'opera':
11            $button.addClass('btn-icon btn-icon--opera');
12            break;
13        case 'yabrowser':
14            $button.addClass('btn-icon btn-icon--yabrowser');
15            break;
16        default:
17            $button.addClass('btn-icon btn-icon--chrome');
18    }
19});
20
21$('.js-install-btn').on('click', function (event) {
22    event.preventDefault();
23
24    var browser = $(this).data('browser');
25
26    if ( ! browser) {
27        browser = detectBrowser();
28    }
29
30    try {
31        //ga('send', 'event', 'install', browser);
32        //yaCounter34280710.reachGoal('install', { browser: browser });
33    } catch(e) {
34    }
35
36    switch (browser) {
37        case 'firefox':
38            document.location.href = getExtensionUrl('firefox-extension');
39            break;
40        case 'chrome':
41        case 'yabrowser':
42            chrome.webstore.install(getExtensionUrl('chrome-webstore-item'));
43            break;
44        default:
45            document.location.href = getExtensionUrl('chromium-extension');
46    }
47});
48
49$(function () {
50    var browser = detectBrowser();
51    $('.js-also-' + browser).show();
52});
53
54function detectBrowser () {
55    var ua = navigator.userAgent;
56
57    if (ua.search(/Firefox/) > -1) {
58        return "firefox";
59    }
60
61    if (ua.search(/OPR/) > -1) {
62        return "opera";
63    }
64
65    if (ua.search(/YaBrowser/) > -1) {
66        return "yabrowser";
67    }
68
69    if (ua.search(/Chrome/) > -1) {
70        return "chrome";
71    }
72
73    if (ua.search(/Safari/) > -1) {
74        return "safari";
75    }
76
77    return null;
78}
79
80function getExtensionUrl (name) {
81    return $('link[rel="' + name + '"]').attr('href');
82}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.