MCPcopy
hub / github.com/DevCloudFE/ng-devui / insertBaiduScript

Function insertBaiduScript

src/utils.ts:1–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1export function insertBaiduScript() {
2 if (typeof document === 'undefined') {return;}
3 const baiduScript = document.createElement('script');
4 const baiduScriptStr = `
5 var _hmt = _hmt || [];
6 (function() {
7 var hm = document.createElement("script");
8 hm.src = "https://hm.baidu.com/hm.js?0c8e27d8ae0d13fbef28c934b5464d5d";
9 var s = document.getElementsByTagName("script")[0];
10 s.parentNode.insertBefore(hm, s);
11 })();
12 `;
13 baiduScript.textContent = baiduScriptStr;
14 document.body.append(baiduScript);
15}

Callers 1

main.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected