PageSourceSearch

https://chatcast.jp/javascripts/widgets.js?url=

js chatcast.jp collected 2026-10-09 22:40:58 UTC 2,081 bytes, 87 lines download raw bytes

1;(function() {
2  function getStyle() {
3    var style = "width:100%;border: none;"
4    return style
5  }
6
7  //後方互換性
8  function getScriptBackwardCompatibility() {
9    var script = document.getElementsByTagName("script")
10    var cc_script = []
11    for (var i = 0, length = script.length; i < length; i++) {
12      var s = script[i]
13
14      //urlがChatCastか判定
15      var re = /https\:\/\/chatca.st\/javascripts\/widgets\.js/gi
16      if (!s.src.match(re)) {
17        continue
18      }
19
20      cc_script.push(s)
21    }
22
23    return cc_script
24  }
25
26  function getScript() {
27    var script = document.getElementsByClassName("chatcast-widget")
28
29    if (script.length < 1) {
30      script = getScriptBackwardCompatibility()
31    }
32
33    for (var i = 0, length = script.length; i < length; i++) {
34      var s = script[i]
35
36      //既に読み込んでいるか判定
37      if (s.getAttribute("data-onload")) {
38        continue
39      }
40
41      //読み込みフラグを付けて、要素を返す
42      s.setAttribute("data-onload", true)
43      return s
44    }
45  }
46
47  function getUrl(selfPath) {
48    var src = selfPath.split("widgets.js?url=")[1]
49    if (typeof src === "undefind" || src === null) {
50      return null
51    } else {
52      return src
53    }
54  }
55
56  function uuid() {
57    var uuid = "",
58      i,
59      random
60    for (i = 0; i < 32; i++) {
61      random = (Math.random() * 16) | 0
62      if (i == 8 || i == 12 || i == 16 || i == 20) {
63        uuid += "-"
64      }
65      uuid += (i == 12 ? 4 : i == 16 ? (random & 3) | 8 : random).toString(16)
66    }
67    return uuid
68  }
69
70  var script = getScript()
71  var id = "cc_iframe_" + uuid()
72  var src = getUrl(script.src) + "&id=" + id
73  var style = getStyle()
74  script.insertAdjacentHTML(
75    "afterend",
76    '<iframe id="' + id + '" style="' + style + '" src="' + src + '"></iframe>',
77  )
78
79  // iframeからメッセージを受け取る
80  window.onmessage = function(e) {
81    if (e.data[0] === "ChatCast") {
82      var id = e.data[1]
83      var height = e.data[2]
84      document.getElementById(id).style.height = height + "px"
85    }
86  }
87})()

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.