PageSourceSearch

https://www.petcity.ee/static/version1790772493/frontend/Opus/petc…/GoogleTranslateLanguageChangedGTMScript.js

js petcity.ee collected 2026-10-05 05:25:15 UTC 1,021 bytes, 27 lines download raw bytes

1if (window.MutationObserver) {
2    new MutationObserver(function (mutations) {
3        mutations.forEach(function (mutation) {
4            const oldElementClass = mutation.oldValue;
5            const currentElementClass = mutation.target.className;
6            const lastEventLanguage = localStorage.getItem('googleTranslateLang');
7            if (
8                lastEventLanguage !== mutation.target.lang
9                && oldElementClass
10                && oldElementClass.indexOf("translated-") === -1
11                && currentElementClass.indexOf("translated-") > -1
12            ) {
13                dataLayer.push({
14                    event: "google_translate_language_click",
15                    language: mutation.target.lang
16                });
17
18                localStorage.setItem('googleTranslateLang', mutation.target.lang);
19            }
20        });
21    }).observe(document.querySelector("html"), {
22        attributes: true,
23        attributeOldValue: true,
24        attributeFilter: ["class"]
25    });
26}
27

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.