PageSourceSearch

https://www.goo-net.com/common/script/graphql.js?20250219

js goo-net.com collected 2026-10-01 10:29:59 UTC 2,992 bytes, 106 lines download raw bytes

1/**
2 * @since new: 2025.02.17
3 */
4
5/**
6 * GraphQLClass
7 */
8function GraphQLClass() {
9}
10/**
11 * GraphQLClass Instance Method
12 */
13GraphQLClass.prototype = {
14    /**
15     * Create HTTP Request Object
16     * 
17     * @returns {Object}: HTTP Request
18     */
19    'createHttpRequest' : function() {
20        try {
21            if (netscape) {
22                netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
23            }
24        } catch (e) {
25        }
26        // Win IE
27        if (window.ActiveXObject) {
28            try {
29                // MSXML2
30                return new ActiveXObject('Msxml2.XMLHTTP');
31            } catch (e) {
32                try {
33                    // Old MSXML
34                    return new ActiveXObject('Microsoft.XMLHTTP');
35                } catch (e2) {
36                    return null;
37                }
38            }
39        } else if (window.XMLHttpRequest) {
40            // Other
41            return new XMLHttpRequest();
42        }
43        return null;
44    }
45};
46// Create Instance
47var GraphQL = new GraphQLClass();
48
49function sendGraphQLAPI(h_param, func, func_param) {
50    var o_http = GraphQL.createHttpRequest();
51    var method = 'GET';
52    var async = true;
53    
54    var url = '/php/api/graphqlApply.php?';
55
56    h_param['rand'] = Math.random();
57    var params = [];
58    for ( var key in h_param) {
59        params.push(key + '=' + h_param[key]);
60    }
61    url += params.join('&');
62
63    // open method
64    o_http.open(method, url, async);
65    o_http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
66    o_http.setRequestHeader('Cache-Control', 'no-cache');
67    if (h_param.use_graphql) {
68        if (localStorage.getItem('idToken')) {
69            o_http.setRequestHeader('id-token',localStorage.getItem('idToken'));
70        }
71
72        if (localStorage.getItem('refreshToken')) {
73            o_http.setRequestHeader('refresh-token',localStorage.getItem('refreshToken'));
74        }
75
76        if (localStorage.getItem('identifier')) {
77            o_http.setRequestHeader('identifier',localStorage.getItem('identifier'));
78        }
79
80        if (localStorage.getItem('password')) {
81            o_http.setRequestHeader('password',localStorage.getItem('password'));
82        }
83    }
84    o_http.onreadystatechange = function() {
85        if (o_http.readyState == 4) {
86            // Call Back
87            if (o_http.status == 200) {
88                var responseText = o_http.responseText;
89                if (responseText != '') {
90                    var data = eval('(' + responseText + ')');
91                    if (data != '' && !data.error_code) {
92                        // Exec function
93                        if (func_param) {
94                            func(data, func_param);
95                        } else {
96                            func(data);
97                        }
98                    }
99                }
100            }
101            o_http = null;
102        }
103    };
104    o_http.send(url);
105}
106

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.