PageSourceSearch

https://www.customs.go.jp/common2018/js/sendKeyword.js

js customs.go.jp collected 2026-10-02 02:17:51 UTC 1,840 bytes, 54 lines download raw bytes

1/*
2 * $Id: sendKeyword.js $
3 *
4 * タイトル : 検索キーワード収集
5 */
6var LOG_PATH = '/searchkw/Send';
7var SITENAME_SITEALLJ = 'q';
8var SITENAME_SITEALLE = 'eq';
9var SITENAME_CANS = 'c';
10var KEYWORD_PARAM = '$Keyword';
11var SITENAME_PARAM = '$SiteName';
12var PATHNAME_SITEALLJ = '/gsearch/result.htm';
13var PATHNAME_SITEALLE = '/gsearch/result_e.htm';
14var PATHNAME_CANS = '/tetsuzuki/c-answer/gsearch/result.htm';
15
16//知的財産サイト内検索検索結果一覧画面を除く
17var PATHNAME_CHIZAI = '/mizugiwa/chiteki/gsearch/result.htm';
18
19  //	キーワード送信処理
20  var  sendKeyword = function(gname, query) {
21  
22	
23  // 検索結果一覧画面のパス
24    var resultPage = location.pathname; 
25
26    // siteName取得
27    if (resultPage.indexOf(PATHNAME_CANS) !== -1) {
28      siteName = SITENAME_CANS;
29    } else if (resultPage.indexOf(PATHNAME_SITEALLE) !== -1) {
30      siteName = SITENAME_SITEALLE;
31    } else if (resultPage.indexOf(PATHNAME_SITEALLJ) !== -1 && resultPage.indexOf(PATHNAME_CHIZAI) === -1) {
32      siteName = SITENAME_SITEALLJ;
33    } else {
34      siteName = null;
35    }
36
37    if (siteName != null) {
38      // キーワード送信
39    var xhr = new XMLHttpRequest();
40    xhr.open('POST', LOG_PATH, true);
41    xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
42    var postData = KEYWORD_PARAM + '=' + encodeURIComponent(query) + '&' + SITENAME_PARAM + '=' + encodeURIComponent(siteName);
43    postData = postData.replace(/%20/g, '+');
44    xhr.send(postData);
45    } 
46
47    // 検索結果一覧画面に検索クエリを返す
48    return query;
49  }; 
50
51
52//Googleカスタム検索コールバック関数呼び出し
53 window.__gcse || (window.__gcse = {});
54    window.__gcse.searchCallbacks = {web: { starting : sendKeyword } };

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.