PageSourceSearch

https://e123.hk/modules/custom/e123_global_js_css/assets/global/js/_dev-switch.js?v=3&v=1

js e123.hk collected 2026-10-01 12:23:05 UTC 1,051 bytes, 29 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function () {
2    // Select all elements matching "a.live-dev-switch"
3    // const links = document.querySelectorAll('a.live-dev-switch');
4    const links = document.querySelectorAll('.toolbar-menu a');
5
6    // Process each link
7    links.forEach(link => {
8        // Get the current domain text from the link
9        let domain2 = link.textContent.trim();
10
11        // Check if the text starts with "->"
12        if (domain2.startsWith("->")) {
13            // Extract the domain after the arrow and trim any whitespace
14            domain2 = domain2.substring(2).trim();
15
16            // Get the current URL
17            const currentUrl = window.location.href;
18
19            // Parse the current URL
20            const urlObj = new URL(currentUrl);
21
22            // Replace the domain portion with the new domain (Domain2)
23            const newUrl = currentUrl.replace(urlObj.host, domain2);
24
25            // Set the href attribute of the link to the new URL
26            link.href = newUrl;
27        }
28    });
29});

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.